Skip to content

Instantly share code, notes, and snippets.

@asifiqbal
Created June 16, 2015 16:02
Show Gist options
  • Save asifiqbal/84fcac7422bdce470707 to your computer and use it in GitHub Desktop.
Save asifiqbal/84fcac7422bdce470707 to your computer and use it in GitHub Desktop.
$ cat /etc/systemd/system/xymon.service
[Unit]
Description=Xymon
[Service]
ExecStart=/bin/su xymon /var/lib/xymon/server/bin/xymon.sh start
ExecStart=/bin/su xymon /var/lib/xymon/server/bin/xymon.sh stop
[Install]
WantedBy=multi-user.target
$ sudo systemctl enable /etc/systemd/system/xymon.service
Created symlink from /etc/systemd/system/multi-user.target.wants/xymon.service to /etc/systemd/system/xymon.service
$ systemctl status xymon.service -l
● xymon.service - Xymon
Loaded: loaded (/etc/systemd/system/xymon.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2015-06-16 11:59:40 EDT; 1min 46s ago
Process: 9282 ExecStop=/bin/su xymon /var/lib/xymon/server/bin/xymon.sh stop (code=exited, status=1/FAILURE)
Process: 9274 ExecStart=/bin/su xymon /var/lib/xymon/server/bin/xymon.sh start (code=exited, status=1/FAILURE)
Main PID: 9274 (code=exited, status=1/FAILURE)
Jun 16 11:59:39 myhost su[9274]: Successful su for xymon by root
Jun 16 11:59:39 myhost su[9274]: + ??? root:xymon
Jun 16 11:59:39 myhost su[9274]: pam_unix(su:session): session opened for user xymon by (uid=0)
Jun 16 11:59:40 myhost systemd[1]: xymon.service: main process exited, code=exited, status=1/FAILURE
Jun 16 11:59:40 myhost su[9282]: Successful su for xymon by root
Jun 16 11:59:40 myhost su[9282]: + ??? root:xymon
Jun 16 11:59:40 myhost su[9282]: pam_unix(su:session): session opened for user xymon by (uid=0)
Jun 16 11:59:40 myhost systemd[1]: xymon.service: control process exited, code=exited status=1
Jun 16 11:59:40 myhost systemd[1]: Unit xymon.service entered failed state.
Jun 16 11:59:40 myhost systemd[1]: xymon.service failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment