Monit Restarts Processes Twice

Issue #961 resolved
Philip Foulkes created an issue

Within Monit, when I configure a process to be dependent on another, and both those processes are part of the same group, if I restart the group, the dependant processes are restarted twice.

For instance, I might have process A and B (both in group GRP), with B being dependent on A. If I issue the command sudo monit restart -g GRP, B will restart twice.

CHECK PROCESS A WITH PIDFILE /path/A.pid
GROUP GRP
START PROGRAM = "start A"
STOP  PROGRAM = "stop A"

CHECK PROCESS B WITH PIDFILE /path/B.pid
GROUP GRP
DEPENDS ON A
START PROGRAM = "start B"
STOP  PROGRAM = "stop B"

I suspect this happens as Monit restarts each process in the group, but then as Monit restarts a process others are dependent on, those dependant processes are restart again.

Does Monit consider the dependencies when restarting groups? It looks like it might have to take them into consideration?

I’m running Monit 5.27.1.

Comments (2)

  1. Tildeslash repo owner

    Fixed: Issue #961: If a service depends on some other service, which is member of the same service group, the service group restart would restart the child service twice.

    → <<cset b69b1d8a4465>>

  2. Log in to comment