[Top][All Lists]

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

Re: monit start/stop in a synchronous mode

From: Martin Pala
Subject: Re: monit start/stop in a synchronous mode
Date: Tue, 14 Oct 2014 10:25:01 +0200

On 13 Oct 2014, at 14:12, Alainkr <address@hidden> wrote:

> Hello Martin,
> I hope I understand you correctly. What I did was  stop monit. Thru the 
> /etc/init.d/monit stop script that I keep from monit 5.4 ( is that ok by the 
> way ? )

Yes, no problem with the 5.4 init script, 5.9 is fully backward compatible

> 'myappcol' stop on user request
> Monit daemon with PID 4714 awakened
> Awakened by User defined signal 1
> 'myappcol-log' stop skipped -- method not defined
> 'myappcol' stop: /etc/init.d/myappcol

> In another terminal : 
> sudo monit stop myappcol
> Command returned immediately despite a long sleep in the stop script (for 
> testing).

OK, there was probably misunderstanding: the processing of stop/start/restart 
commands is synchronous internally in Monit and if the service is process type, 
Monit (5.9+) always waits for the program to finish and process to stop/start 
(by observing its PID on stop or checking for process on start). Older Monit 
versions did the same sequence, but used shortcut by not waiting for the 
program to finish and only observed the PID (this was problem on some 
platforms) - for non-process types it just executed the program and didn't wait 
for it to finish (5.9 waits regardless of service type). Note: there is also 
timeout associated with the command (by default 30 seconds).

The CLI however doesn't wait for the requested action to finish - when you do 
for example "monit stop myappcol" it sends command to Monit to do the work and 
returns immediately. Monit wakes up when it receives the command and performs 
the requested action on background.

If i understand you corrently, you wanted CLI to not return before the action 
is done by Monit?

> 2014-10-13 11:52 GMT+02:00 Martin Pala [via nongnu] <[hidden email]>:
> Hello Alain, 
> please can you run monit 5.9 in verbose mode, restart the service using 
> either GUI or CLI (CLI will need different terminal and -I will run monit in 
> foreground) and provide output?: 
>         monit -vI 
> Regards, 
> Martin 
> On 10 Oct 2014, at 21:54, Alainkr <[hidden email]> wrote: 
> > Hello, 
> > 
> > Just tried 5.9 and I’m still getting the same behavior. 
> > I’m using debian wheezy.  I compiled monit 5.9 from the source. 
> > 
> > Thanks for your help 
> > 
> > Alain 
> > 
> > 

reply via email to

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