invirt-web: make initscript stop command not leave apache2 processes lying around
[invirt/packages/invirt-web.git] / files / etc / init.d / apache2.invirt
index d74ba3b..3a4d69b 100755 (executable)
@@ -24,7 +24,7 @@ kstart_start () {
     chown www-data $KRB5CCNAME
     /sbin/start-stop-daemon --start --pidfile "$TMP_PIDFILE" -c www-data \
        --exec /usr/bin/k5start -- -b -p "$TMP_PIDFILE" \
-       -U -f "$KSTART_KEYTAB" -K10 -S afs -I "$AFSCELL" -t \
+       -f "$KSTART_KEYTAB" -K10 -S afs -I "$AFSCELL" -t \
         "daemon/$(hostname -f)"
     cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE"
     rm -f "$TMP_PIDFILE"
@@ -32,6 +32,11 @@ kstart_start () {
 kstart_stop () {
     if [ -e $KSTART_PIDFILE ]; then
        /sbin/start-stop-daemon --stop --pidfile $KSTART_PIDFILE
+        pgrep apache2 >/dev/null && sleep 1 \
+         && pgrep apache2 >/dev/null && sleep 1 \
+         && pgrep apache2 >/dev/null && sleep 1 \
+         && pgrep apache2 >/dev/null && sleep 1 \
+         && pkill -9 apache2
        rm -f $KSTART_PIDFILE
     else
        echo -n " ... no kstart pidfile"