[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Monit definitely not waiting for stop scripts to complete...
From: |
Jason L. Buberel |
Subject: |
Monit definitely not waiting for stop scripts to complete... |
Date: |
Mon, 03 Sep 2007 18:21:13 -0700 |
User-agent: |
Thunderbird 2.0.0.0 (X11/20070326) |
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
- Monit definitely not waiting for stop scripts to complete...,
Jason L. Buberel <=