[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling stop program when the process doesn't exist

From: Martin Pala
Subject: Re: calling stop program when the process doesn't exist
Date: Sun, 6 May 2012 18:18:15 +0200


before monit calls the stop program, it checks whether the process is running - if not, then the stop program is intentionally skipped (optimization).

If you need to always call stop before start, you can put it to the start program like this:
start program = "/bin/bash -c '/tmp/ && /tmp/'"


On Apr 17, 2012, at 10:45 AM, jing ping wrote:

I configured a monit control file to  restart a service in case the service is stopped accidentally. 
check process servicea with pidfile /var/run/
    start program = "/tmp/"
    stop program = "/tmp/" 
    if does not exist then restart
    # add connection checking
    if failed port 80 type tcp then restart
>From the monit guide, restart action shall call stop, then start program defined. If failed to check port, monit did stopped the service, then started it. However, in "does not exist" case, only start program was invoked. Is it expectable? As I want to send alarm in stop program when detect the service has gone, is there another way to trigger both stop and start if restart can't do?
To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]