[Top][All Lists]

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

[monit] Re: Monit definitely not waiting for stop scripts to complete

From: Martin Pala
Subject: [monit] Re: Monit definitely not waiting for stop scripts to complete
Date: Fri, 14 Mar 2008 23:36:36 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080129 Iceape/1.1.8 (Debian-1.1.8-2)

On Sep 5, 2007, at 6:47 PM, Jason L. Buberel wrote:

Jan-Henrik, Stanislaw,

Thanks for your thoughtful consideration/response.

Question #1) Maybe start time is not the crucial point here, but rather "correctness", that is, monit should wait for A to come up before starting B and so on?

My Answer) My preference would trust the start/stop script with the responsibility of determining when it has completed its processing and the service is fully started or stopped. Monit's approach - detecting the presence of the PID and the process - takes that responsibility away from the script. For most services, that assumption is a safe one. But there are many cases of more complex services for which process creation and PID file creation happen well before that service is fully started. For that reason, I would vote in favor of making all start/stop actions synchronous. If you are concerned with start/stop scripts taking too long to completed, I would suggest the use of a timeout value:

check process tomcat with pidfile /var/run/
    stop program with timeout 30 seconds = "/etc/init.d/tomcat stop"
    start program with timeout 30 seconds = "/etc/init.d/tomcat start"
If the start/stop script does not exit within the timeout period, the execution attempt should be considered to have failed.

Both these features are implemented now (will be part of next monit version):

- stop and start are synchronous
- it is possible to define stop and start timeout


reply via email to

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