systemd 应用异常退出自启动 + 日志重定向

[Unit]
Description=agent server daemon
After=network.target
[Service]
Type=simple
ExecStart=/bin/sh -c '/usr/local/artifacts/agent/bin/-agent -c /usr/local/artifacts/agent/conf/cfg.agent.json 1>>/usr/local/artifacts/agent/logs/out.log 2>&1'
Restart=on-failure

[Install]
WantedBy=multi-user.target

注意文件夹事先实现创建!!

你可能感兴趣的:(systemd 应用异常退出自启动 + 日志重定向)