[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 (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:

while : ; do
   [ -f /opt/squid/var/logs/ ] || break
   if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then
       return 1
   sleep 2 && echo -n "."

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:

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?


reply via email to

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