PID=0
fi
daemon httpd.${HTTPD_MPM} -f /etc/httpd/httpd.conf -k stop
+ RET=$?
# Wait for httpd to really stop
- if [ ! $PID -eq 0 ]; then
+ if [ ! $PID -eq 0 -a $RET -eq 0 ]; then
show "Waiting for httpd to stop"
busy
while ps -o command $PID | grep -q ^httpd
done
ok
fi
- rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
+ # Delete pidfile only when apache was called successfully
+ if [ $RET -eq 0 ]; then
+ rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
+ fi
else
msg_not_running httpd.${HTTPD_MPM}
fi