On Tue, Apr 15, 2014 at 6:13 AM, hzwaal <[email protected]> wrote:

> I'm monitoring the liveness of one of my processes through its HTTP
> connection. I have the following relevant settings:
>
> set daemon 2 # check every 2 seconds (a short period is required in my
> case)
>
> check process soandso with pidfile /such/and/such
>   start program = ...
>   stop program = ...
>   if failed url http://localhost/ping
>     with timeout 5 seconds for 5 cycles
>     then restart
>
> Now, when my process gets stuck (it shouldn't, but I'm simulating this,
> just
> in case) it will be restarted. This occurs 5 second after the 5th poll,
> which is when it is not responding for 13 seconds (4 * 2 + 5). So far so
> good.
>
> However, when my process is not back online within 2 seconds, it will be
> restarted again, and again, ad infinitum. This seems like a bug to me.
>

Ignoring the fact that 2 second poll seems silly use the timeout parameter.
Find out how long it takes the stop init script to run and then double it.

check process soandso with pidfile /such/and/such
  start program = ...
  stop program = ... with timeout 10 seconds
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to