monit-general
[Top][All Lists]
Advanced

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

Re: Monit definitely not waiting for stop scripts to complete...


From: Stanisław Trytek
Subject: Re: Monit definitely not waiting for stop scripts to complete...
Date: Wed, 05 Sep 2007 15:42:33 +0200
User-agent: Opera Mail/9.20 (Linux)


From our experience monit works properly when closing services. It closes services in accordance with declared dependieces and services wait for another.
Your problem may be caused by stdout, it can happen.
The problem is with starting services. In spite of dependencies monit starts them at once, and it causes mess in some environments. It would be great if both starting and stoping work synchronusly. We made some attempts to overcome this issue.
Stanislaw Trytek
--
_________________________________________
PRZEMYSŁOWY INSTYTUT TELEKOMUNIKACJI
TELECOMMUNICATIONS RESEARCH INSTITUTE
ul. Poligonowa 30,  04-051 Warszawa,  Poland
tel: +48 (22) 48 65 232
fax: +48 (22) 48 65 494
e-mail: address@hidden


On Tue, 04 Sep 2007 03:21:13 +0200, Jason L. Buberel <address@hidden> wrote:

My configuration is using monit 4.10-beta-1 on RHEL3. I have configured a dependency chain for squid and apache:

squid ---depends-on--> apache

Squid in particular can take a while to shutdown. In fact the official squid init.d script contains a section that looks like this:

timeout=0
while : ; do
    [ -f /opt/squid/var/logs/squid.pid ] || break
    if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then
        echo
        return 1
    fi
    sleep 2 && echo -n "."
    timeout=$((timeout+2))
done

When I issue a 'monit restart apache' command, I see the following in stdout:

'squid' stop: /etc/init.d/squid.local
Stopping squid: 'apache' stop: /usr/local/bin/stop-apache.bash
.                                                          [  OK  ]

Which tells me that the 'apache stop' is being executed before the 'squid stop' has actually completed. If the commands were executed serially, the output would have been:

'squid' stop: /etc/init.d/squid.local
Stopping squid: ......                     [ OK ]
'apache' stop: /usr/local/bin/stop-apache.bash

This seems similar to what is described:
http://lists.nongnu.org/archive/html/monit-general/2007-04/msg00007.html

Would it be possible to add a 'synchronous' flag to the start/stop parameters to force monit to wait for the script to exit fully:

start synchronous "/etc/init.d/service start"
stop synchronous "/etc/init.d/service stop"

Or something to that effect?

-jason






--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

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