|
|
checkconfig || return 1 | checkconfig || return 1 |
ebegin "Stopping apache2" | ebegin "Stopping apache2" |
${APACHE2} ${APACHE2_OPTS} -k stop | ${APACHE2} ${APACHE2_OPTS} -k stop |
|
|
|
PID=`cat /var/run/apache2.pid 2>/dev/null` |
|
|
|
# Now we have to wait until squid has _really_ stopped. |
|
sleep 2 |
|
if test -n "$PID" && kill -0 $PID 2>/dev/null |
|
then |
|
einfon "Waiting ." |
|
cnt=0 |
|
while kill -0 $PID 2>/dev/null |
|
do |
|
cnt=`expr $cnt + 1` |
|
if [ $cnt -gt 60 ] |
|
then |
|
# Waited 120 seconds now. Fail. |
|
eend 1 "Failed." |
|
break |
|
fi |
|
sleep 2 |
|
echo -n "." |
|
done |
|
echo -n "done." |
|
eend 0 |
|
else |
|
eend 0 |
|
fi |
|
|
eend $? | eend $? |
} | } |
| |