[Top][All Lists]

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

Re: monit restart and pid file for daemon via init.d script

From: Martin Pala
Subject: Re: monit restart and pid file for daemon via init.d script
Date: Tue, 28 Oct 2014 17:36:51 +0100


please upgrade to Monit 5.9 - it fixes the problem.


> On 28 Oct 2014, at 17:32, Denis Samoilov <address@hidden> wrote:
> Hi,
> I have a problem that monit issues "start" command before "stop" is finished. 
> My service creates pid file and my init.d script removes pid file in "stop". 
> So what happens - when I execute 
> monit restart myservice
> it does:
> stop
> start
> but stop is not synchronous -  part that removes pid file is not finishes 
> when start is executed. So this leads to the situation that start creates a 
> pid file and rest of stop deletes it. And monit starts to complain that no 
> pid file exists. 
> My question: how to force monit to wait till "stop" action in init.d script 
> finishes and only after do start?
> and just to my own education - how monit decides that start should be run?
> my monit script is pretty standard:
> check process apache with pidfile /var/run/
>     start program = "/etc/init.d/mydaemond start" 
>     stop program  = "/etc/init.d/mydaemond stop" 
> Thank you,
> Denis
> --
> To unsubscribe:

reply via email to

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