Use sh instead of pagsh for init scripts
[hcoop/domtool2.git] / scripts / domtool-slave
index 5392bea..e51ac89 100755 (executable)
@@ -1,12 +1,26 @@
-#!/usr/bin/pagsh.openafs
+#!/bin/sh
+# -*- sh -*-
 
 # This script should go in /etc/init.d/ on Debian Linux systems
 # running Domtool slaves.
 
 
 # This script should go in /etc/init.d/ on Debian Linux systems
 # running Domtool slaves.
 
+# This script is NOT lsb compliant by a long shot... need to fix that
+# We need nscd running to lookup afs users for whatever reason
+
+### BEGIN INIT INFO
+# Provides:             domtool-slave
+# Required-Start:       $remote_fs $network $time openafs-client nscd
+# Required-Stop:        $remote_fs $network openafs-client nscd
+# Default-Start:        2 3 4 5
+# Default-Stop:         0 1 6
+# Short-Description:    Domtool Slave
+# Description:          Launches the domtool slave
+### END INIT INFO
+
 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
 PIDFILE="/var/run/domtool/k5start-slave.pid"
 
 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
 PIDFILE="/var/run/domtool/k5start-slave.pid"
 
-set -e
+. /lib/lsb/init-functions
 
 case $1 in
   start)
 
 case $1 in
   start)
@@ -16,16 +30,16 @@ case $1 in
        else
                PIDDIR=$(dirname "$PIDFILE")
                if test ! -d "$PIDDIR"; then
        else
                PIDDIR=$(dirname "$PIDFILE")
                if test ! -d "$PIDDIR"; then
-                       mkdir -m 0755 $PIDDIR
-                       chown domtool:domtool $PIDDIR
+                       mkdir -m 0750 $PIDDIR
+                       chown domtool:nogroup $PIDDIR
                fi
 
                start-stop-daemon --start --pidfile $PIDFILE \
                fi
 
                start-stop-daemon --start --pidfile $PIDFILE \
-                       -c domtool:domtool \
+                       -c domtool:nogroup \
                        --exec /usr/bin/k5start -- -U -b \
                        -f /etc/keytabs/domtool \
                        -K 300 -t -p $PIDFILE \
                        --exec /usr/bin/k5start -- -U -b \
                        -f /etc/keytabs/domtool \
                        -K 300 -t -p $PIDFILE \
-                       domtool-slave-logged
+                       /usr/local/bin/domtool-slave-logged
                echo "."
        fi
        ;;
                echo "."
        fi
        ;;