X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/feb4074d2d01eeaec7710781482b28e30417d061..cf6f5dce52a7c2ecdd5da56a5687c23689d0b9e3:/files/etc/init.d/apache2.invirt diff --git a/files/etc/init.d/apache2.invirt b/files/etc/init.d/apache2.invirt index 34c6baa..3a4d69b 100755 --- a/files/etc/init.d/apache2.invirt +++ b/files/etc/init.d/apache2.invirt @@ -1,12 +1,19 @@ #!/usr/bin/pagsh -e +### BEGIN INIT INFO +# Provides: apache2 +# Required-Start: $local_fs $remote_fs $network $syslog openafs-client +# Required-Stop: $local_fs $remote_fs $network $syslog openafs-client +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/stop apache2 web server +### END INIT INFO # # Apache kstart wrapper by anders. # SCRIPT=/etc/init.d/apache2.invirt-orig KSTART_PIDFILE=/var/run/k5start-apache2.pid -KSTART_KEYTAB=/etc/apache2/keytab -INSTANCE=xvm-2.mit.edu +KSTART_KEYTAB=/etc/invirt/keytab export AFSCELL=sipb.mit.edu @@ -17,13 +24,19 @@ 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" \ - -f "$KSTART_KEYTAB" -K10 -u daemon -i "$INSTANCE" -S afs -I sipb.mit.edu -t -b + -f "$KSTART_KEYTAB" -K10 -S afs -I "$AFSCELL" -t \ + "daemon/$(hostname -f)" cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE" rm -f "$TMP_PIDFILE" } 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"