4 # Required-Start: $local_fs $remote_fs $network $syslog openafs-client
5 # Required-Stop: $local_fs $remote_fs $network $syslog openafs-client
6 # Default-Start: 2 3 4 5
8 # Short-Description: Start/stop apache2 web server
11 # Apache kstart wrapper by anders.
14 SCRIPT=/etc/init.d/apache2.invirt-orig
15 KSTART_PIDFILE=/var/run/k5start-apache2.pid
16 KSTART_KEYTAB=/etc/invirt/keytab
18 export AFSCELL=sipb.mit.edu
21 TMP_PIDFILE=$(mktemp /tmp/k5start-apache2.pid-XXXXXX)
22 chown www-data "$TMP_PIDFILE"
23 export KRB5CCNAME=$(mktemp /tmp/krb5cc_33.kstart-XXXXXX)
24 chown www-data $KRB5CCNAME
25 /sbin/start-stop-daemon --start --pidfile "$TMP_PIDFILE" -c www-data \
26 --exec /usr/bin/k5start -- -b -p "$TMP_PIDFILE" \
27 -f "$KSTART_KEYTAB" -K10 -S afs -I "$AFSCELL" -t \
28 "daemon/$(hostname -f)"
29 cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE"
33 if [ -e $KSTART_PIDFILE ]; then
34 /sbin/start-stop-daemon --stop --pidfile $KSTART_PIDFILE
35 pgrep apache2 >/dev/null && sleep 1 \
36 && pgrep apache2 >/dev/null && sleep 1 \
37 && pgrep apache2 >/dev/null && sleep 1 \
38 && pgrep apache2 >/dev/null && sleep 1 \
42 echo -n " ... no kstart pidfile"
48 echo -n "Starting kstart for Apache2: k5start"
55 echo -n "Stopping kstart for Apache2: k5start"