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)
http://mmonit.com/monit/
Other
515 stars 63 forks source link

systemd compatability #3

Open tuwid opened 8 years ago

tuwid commented 8 years ago

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"