[Unit]
Description=some program
Wants=network-online.target
After=network.target network-online.target
[Service]
ExecStart=<someprogram>
StandardOutput=tty
#StandardOutput=append:/var/log/syncstd.log
StandardError=append:/var/log/syncerr.log
TTYPath=/dev/pts/2
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
参考:
http://www.jinbuguo.com/systemd/systemd.exec.html#
jinbuguo.com/systemd/systemd.html