Monit uses "restart program" instead of "start program" when service is down

Issue #69 resolved
Former user created an issue

I think monit should use "start", when process is down and "restart" when I say monit restart.

[CEST Jul 10 07:58:28] error : 'great_stuff' process is not running [CEST Jul 10 07:58:28] info : 'great_stuff' trying to restart [CEST Jul 10 07:58:28] info : 'great_stuff' restart: /etc/init.d/trackrdrd [CEST Jul 10 07:59:58] error : 'great_stuff' failed to start

I actually have a few processes where restart doesnt't work when process is down and I don't want to rewrite my init scripts.

Hans

Comments (2)

  1. Tildeslash repo owner

    If the process is not running, Monit triggers the "restart" action. The restart action itself depends on your Monit configuration:

    1.) if your service has "start program" and "stop program" only, then Monit will execute the stop action only in the case, that the process is still running, otherwise stop is skipped and start program is called.

    2.) Monit 5.7 or later has also "restart program" ... if it is defined, then it is preferred over stop+start for restart action.

    => the above described method (1) will call start only if the process died

  2. Log in to comment