source: trunk/packages/sipb-xen-www/files/etc/init.d/apache2.invirt @ 996

Last change on this file since 996 was 854, checked in by price, 16 years ago

take instance from keytab in k5start apache2.init wrapper

  • Property svn:executable set to *
File size: 1.2 KB
RevLine 
[768]1#!/usr/bin/pagsh -e
2#
3# Apache kstart wrapper by anders.
4#
5
6SCRIPT=/etc/init.d/apache2.invirt-orig
7KSTART_PIDFILE=/var/run/k5start-apache2.pid
8KSTART_KEYTAB=/etc/apache2/keytab
9
10export AFSCELL=sipb.mit.edu
11
12kstart_start () {
13    TMP_PIDFILE=$(mktemp /tmp/k5start-apache2.pid-XXXXXX)
14    chown www-data "$TMP_PIDFILE"
15    export KRB5CCNAME=$(mktemp /tmp/krb5cc_33.kstart-XXXXXX)
16    chown www-data $KRB5CCNAME
17    /sbin/start-stop-daemon --start --pidfile "$TMP_PIDFILE" -c www-data \
18        --exec /usr/bin/k5start -- -b -p "$TMP_PIDFILE" \
[854]19        -U -f "$KSTART_KEYTAB" -K10 -S afs -I "$AFSCELL" -t -b
[768]20    cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE"
21    rm -f "$TMP_PIDFILE"
22}
23kstart_stop () {
24    if [ -e $KSTART_PIDFILE ]; then
25        /sbin/start-stop-daemon --stop --pidfile $KSTART_PIDFILE
26        rm -f $KSTART_PIDFILE
27    else
28        echo -n " ... no kstart pidfile"
29    fi
30}
31
32case "$1" in
33  start)
34    echo -n "Starting kstart for Apache2: k5start"
35    kstart_start
36    echo "."
37    exec "$SCRIPT" start
38    ;;
39  stop)
40    "$SCRIPT" stop
41    echo -n "Stopping kstart for Apache2: k5start"
42    kstart_stop
43    echo "."
44    ;;
45  restart|force-reload)
46    "$0" stop
47    sleep 1
48    "$0" start
49    ;;
50  *)
51    exec "$SCRIPT" "$@"
52    ;;
53esac
Note: See TracBrowser for help on using the repository browser.