Раньше у меня была эта стартовая работа:
description "This is Notification Service"
author "King"
start on runlevel [2345]
exec watch -n 1 /usr/bin/curl -s https://domain.com/cron >/dev/null 2>&1
Теперь я преобразовал ее в systemd:
[Unit]
Description=This is Notification Service
[Service]
ExecStart=/bin/bash -c '/usr/bin/watch -n 1 /usr/bin/curl -s https://domain.com/cron >/dev/null 2>&1'
[Install]
WantedBy=multi-user.target
Но она не работает, она всегда терпит неудачу, когда Я начинаю.
● notify-fb.service - This is Notification Service
Loaded: loaded (/etc/systemd/system/notify-fb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2016-09-25 02:25:02 PST; 3h 53min ago
Process: 15299 ExecStart=/usr/bin/watch -n 1 /usr/bin/curl -s https://domain.com/cron (code=exited, status=1/FAILURE)
Main PID: 15299 (code=exited, status=1/FAILURE)
Sep 25 02:25:02 xxxx.com systemd[1]: Started This is Notification Service.
Sep 25 02:25:02 xxxx.com watch[15299]: Error opening terminal: unknown.
Sep 25 02:25:02 xxxx.com systemd[1]: notify-fb.service: Main process exited, code=exited, status=1/FAILURE
Sep 25 02:25:02 xxxx.com systemd[1]: notify-fb.service: Unit entered failed state.
Sep 25 02:25:02 xxxx.com systemd[1]: notify-fb.service: Failed with result 'exit-code'.