I’m successfully (and happily) using Monit to monitor services that have suddenly exited on a CentOS 7 setup. For example:
check process mariadb with pidfile /var/lib/mysql/hostname.pid
start program = "/bin/systemctl start mariadb"
stop program = "/bin/systemctl stop mariadb"
restart program = "/bin/systemctl restart mariadb"
if failed port 3306 protocol mysql then restart
if 3 restarts within 5 cycles then unmonitor
Do I need to do anything else to make Monit and systemd play together nicely? My concerns are:
1. What happens when the system is shutting down, does Monit frantically try to start things up that are shutting down, or has Monit itself been stopped by that point?
2. Is there are problem with Monit trying to start services at the same time systemd does at system boot time?
Thanks in advance!