arnaudsj / monit

Monit is a free open source utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. (unofficial mirror)

Home Page:http://mmonit.com/monit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

systemd compatability

tuwid opened this issue · comments

In the examples the start and stop use the init.d but on servers with systemd if you use the init script the
pid doesnt get updated so when you do a service status you get the status of the service dead

/etc/monit/monitrc.d/rsyslog


 check process rsyslogd with pidfile /var/run/rsyslogd.pid
   group system
   group rsyslogd
   start program = "/etc/init.d/rsyslog start"
   stop  program = "/etc/init.d/rsyslog stop"
   if 5 restarts with 5 cycles then timeout

This can be easily fixed by updating the start and stop with

   start program = "/bin/systemctl start rsyslog"
   stop  program = "/bin/systemctl stop rsyslog"