Fix regeneration of multi-file dependencies
[hcoop/domtool2.git] / scripts / domtool-server
CommitLineData
62260c5f
AC
1#!/usr/bin/pagsh.openafs
2
a78867dd
MO
3# This script should go in /etc/init.d/ on Debian Linux systems
4# running Domtool dispatchers.
62260c5f
AC
5
6SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
a78867dd 7PIDFILE="/var/run/domtool/k5start-server.pid"
62260c5f
AC
8
9set -e
10
11case $1 in
12 start)
62260c5f
AC
13 echo -n "Starting Domtool dispatcher: domtool-server"
14 if sudo -u domtool domtool-admin-sudo ping; then
15 echo "...already running."
16 else
a78867dd
MO
17 PIDDIR=$(dirname "$PIDFILE")
18 if test ! -d "$PIDDIR"; then
19 mkdir -m 0755 $PIDDIR
20 chown domtool:domtool $PIDDIR
21 fi
22
62260c5f
AC
23 start-stop-daemon --start --pidfile $PIDFILE \
24 -c domtool:domtool \
e8872a45 25 --exec /usr/bin/k5start -- -U -b \
721ff8cc 26 -f /etc/keytabs/domtool \
62260c5f 27 -K 300 -t -p $PIDFILE \
62260c5f
AC
28 domtool-server-logged
29 echo "."
30 fi
31 ;;
32
33 stop)
34 echo -n "Stopping Domtool dispatcher: domtool-server"
35 if sudo -u domtool domtool-admin-sudo shutdown; then
36 echo "."
37 else
38 start-stop-daemon --stop --pidfile $PIDFILE
39 echo "."
40 fi
41 rm -f $PIDFILE
42 ;;
43
44 restart|reload|force-reload)
cf1be826 45 set +e; $SELF stop; set -e
62260c5f
AC
46 $SELF start
47 ;;
48
49 status)
50 if sudo -u domtool domtool-admin-sudo ping; then
51 echo "Domtool dispatcher is running."
52 else
53 echo "Domtool dispatcher is stopped."
54 exit 3
55 fi
56 ;;
57
58 *)
59 echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
60 exit 1
61 ;;
62esac