add vcs-* fields to debian/control
[debian/orchestra.git] / debian / orchestra-conductor.init
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides:             orchestra-conductor
5 # Required-Start:       networking
6 # Required-Stop:        networking
7 # Default-Start:        2 3 4 5
8 # Default-Stop:         0 1 6
9 # Short-Description:    Conductor queue manager for Orchestra
10 ### END INIT INFO
11
12 set -e
13
14 export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
15
16 CONDUCTOR=/usr/sbin/conductor
17
18 test -x "${CONDUCTOR}" || exit 0
19
20 CONDUCTOR_ARGS=""
21 ENABLED=no
22 PIDFILE=/var/run/orchestra-conductor.pid
23
24 if test -f /etc/default/orchestra-conductor; then
25    . /etc/default/orchestra-conductor
26 fi
27
28 . /lib/lsb/init-functions
29
30 if [ "${ENABLED}" != "yes" ]; then
31     exit 0
32 fi
33
34 case "$1" in
35     start)
36         log_daemon_msg "Starting the Conductor"
37         if start-stop-daemon --start --quiet --oknodo --background --pidfile "${PIDFILE}" --make-pidfile --exec "${CONDUCTOR}" -- ${CONDUCTOR_ARGS}; then
38             log_end_msg 0
39         else
40             log_end_msg 1
41         fi
42         ;;
43     stop)
44         log_daemon_msg "Stopping the Conductor"
45         if start-stop-daemon --stop --quiet --oknodo --pidfile "${PIDFILE}" -x "${CONDUCTOR}"; then
46             log_end_msg 0
47         else
48             log_end_msg 1
49         fi
50         ;;
51     reload)
52         log_daemon_msg "Asking the Conductor to Reload Configuration"
53         if start-stop-daemon --stop --quiet --signal HUP --pidfile "${PIDFILE}" -x "${CONDUCTOR}"; then
54             log_end_msg 0
55         else
56             log_end_msg 1
57         fi
58         ;;
59     status)
60         status_of_proc -p "${PIDFILE}" "${CONDUCTOR}" conductor && exit 0 || exit $?
61         ;;
62     *)
63         log_action_msg "Usage: /etc/init.d/orchestra-conductor {start|stop|reload|status}"
64         exit 1
65         ;;
66 esac