Sample Header Ad - 728x90

What command in monitrc can I use to start/stop systemd services?

15 votes
3 answers
10063 views
I like using monit for the web interface where I can see running monitored processes. I recently upgraded a server to Ubuntu 16.04 and it is using systemd. I have everything else running but I cannot find the right monit commands to control systemd... I used to do /etc/init.d/process start or stop or whatever. That obivously no longer works so I tried ... systemctl start process which didn't work either. What can I do here? My monitrc is pasted below...(old style which worked on 14.04) check process nginx with pidfile /var/run/nginx.pid start program = "/etc/init.d/nginx start" stop program = "/etc/init.d/nginx stop" check process sshd with pidfile /var/run/sshd.pid start program = "etc/init.d/ssh start" stop program = "etc/init.d/ssh stop"
Asked by Joff (393 rep)
Nov 18, 2016, 03:54 AM
Last activity: May 21, 2020, 08:59 AM