[Top][All Lists]

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

Re: Processes starting twice when using "check program"

From: Callum Macdonald
Subject: Re: Processes starting twice when using "check program"
Date: Thu, 06 Sep 2012 11:26:11 +0100

You could call as part of to make sure
that the worker is not already running. That's probably a good idea
anyway, so that your process can't be started twice. Not sure about the
monit angle, maybe there's something that can be changed there. - C

On Wed, 2012-09-05 at 22:22 -0700, Jonathan Apostoles wrote:
> Due to the way monit checks statuses it's starting my process twice on
> recovery.
> Example:
> check program locker_worker_status with path
> "/home/monit/"
>     start program = "/home/monit/"
>     if status != 0 then start
> Imagine the worker is down and monit is set to check every minute:
> 0m- run check program (it's down, but wont read the status code until
> the next cycle)
> 1m- read status, it's DOWN
> 1m- run check program (it's still down at this point) -- will read
> next cycle
> 1m- since status was down, run
> 2m- read status, it's DOWN (since it's from the run @1m)
> 2m- run check program (it's up at this point) -- will read next cycle
> 2m- since status was down, run
> 3m- read status, it's UP
> Is there a way to have it read the status BEFORE responding to it?
>  The way it works now it seems to be always a minute behind and suffer
> from recovering from a process that has already been recovered.  Is
> there any workaround so that my process only starts once?
> --
> To unsubscribe:

reply via email to

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