Proposed fix, beware its not been checked for bashisms.
This also adds the check on stop.
-- Mvh, André Tomt [EMAIL PROTECTED]
--- /etc/init.d/apache2 2005-02-19 03:07:20.000000000 +0100 +++ /etc/init.d/apache2.fixed 2005-02-19 03:02:59.000000000 +0100 @@ -32,7 +32,31 @@ apache_stop() { if `apache2 -t > /dev/null 2>&1`; then # if the config is ok than we just stop normaly - $APACHE2 -k stop + + if [ -f /var/run/apache2.pid ] + then + PID=$(cat /var/run/apache2.pid) + + $APACHE2 -k stop + + CNT=0 + while [ 1 ] + do + CNT=$(expr $CNT + 1) + + [ ! -d /proc/$PID ] && break + + if [ $CNT -gt 60 ] + then + echo " ... failed!" + echo "Apache2 failed to honor the stop command, please investigate the situation by hand." + exit 1 + fi + + sleep 1 + done + fi + else # if we are here something is broken and we need to try # to exit as nice and clean as possible @@ -105,7 +129,6 @@ restart | force-reload) echo -n "Forcing reload of web server: Apache2" apache_stop - sleep 10 $APACHE2CTL startssl echo "." ;;