Considerations when using Monit with systemd

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Considerations when using Monit with systemd

Jamie Burchell

Hi!

 

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?

 

I have read https://mmonit.com/monit/documentation/monit.html#SYSTEM-REBOOT-AND-SERVICE-STARTUP.

 

Thanks in advance!

Jamie

 


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: Considerations when using Monit with systemd

martinp@tildeslash.com
Hi,

if you control the same services with systemd and the system is stopping, monit should be stopped first to prevent collision between monit and systemd.

Starting the system services on boot in parallel with systemd should work fine - systemd will just get a request from monit to start the service and even if the start is pending already, it's no problem.

Best regards,
Martin


On 16 Apr 2019, at 14:01, Jamie Burchell <[hidden email]> wrote:

Hi!

 

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!
Jamie

 

-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general