Fixed a comment in redhat script, added Debian script.
[shibboleth/cpp-sp.git] / configs / shibd-debian.in
1 #! /bin/sh\r
2 ### BEGIN INIT INFO\r
3 # Provides: shibd\r
4 # Required-Start: $local_fs $remote_fs $network\r
5 # Required-Stop: $local_fs $remote_fs $network\r
6 # Default-Start: 2 3 4 5\r
7 # Default-Stop: S 0 1 6\r
8 # Short-Description: Shibboleth 2 Service Provider Daemon\r
9 # Description: Starts the separate daemon used by the Shibboleth\r
10 # Apache module to manage sessions and to retrieve\r
11 # attributes from Shibboleth Identity Providers.\r
12 ### END INIT INFO\r
13 #\r
14 # Written by Quanah Gibson-Mount <quanah@stanford.edu>\r
15 # Modified by Lukas Haemmerle <lukas.haemmerle@switch.ch> for Shibboleth 2\r
16 # Based on the dh-make template written by:\r
17 #\r
18 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.\r
19 # Modified for Debian\r
20 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.\r
21 \r
22 PATH=/sbin:/bin:/usr/sbin:/usr/bin\r
23 DESC="Shibboleth 2 daemon"\r
24 NAME=shibd\r
25 SHIB_HOME=/opt/shibboleth-sp\r
26 SHIB_ETC=$SHIB_HOME/etc/shibboleth\r
27 SHIBSP_CONFIG=$SHIB_ETC/shibboleth2.xml\r
28 LD_LIBRARY_PATH=$SHIB_HOME/lib\r
29 DAEMON=$SHIB_HOME/sbin/$NAME\r
30 SCRIPTNAME=/etc/init.d/$NAME\r
31 PIDFILE=/var/run/$NAME.pid\r
32 DAEMON_OPTS=""\r
33 \r
34 # Force removal of socket\r
35 DAEMON_OPTS="$DAEMON_OPTS -f"\r
36 \r
37 # Use defined configuration file\r
38 DAEMON_OPTS="$DAEMON_OPTS -c $SHIBSP_CONFIG"\r
39 \r
40 # Specify pid file to use\r
41 DAEMON_OPTS="$DAEMON_OPTS -p $PIDFILE"\r
42 \r
43 # Exit if the package is not installed.\r
44 [ -x "$DAEMON" ] || exit 0\r
45 \r
46 # Read configuration if it is present.\r
47 [ -r /etc/default/$NAME ] && . /etc/default/$NAME\r
48 \r
49 # Get the setting of VERBOSE and other rcS variables.\r
50 [ -f /etc/default/rcS ] && . /etc/default/rcS\r
51 \r
52 case "$1" in\r
53 start)\r
54     # Don't start shibd if NO_START is set.\r
55     if [ "$NO_START" = 1 ] ; then\r
56         echo "Not starting $DESC (see /etc/default/$NAME)"\r
57         exit 0\r
58     fi\r
59     echo -n "Starting $DESC: "\r
60     start-stop-daemon --background --start --quiet \\r
61         --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS\r
62     echo "$NAME."\r
63     ;;\r
64 stop)\r
65     echo -n "Stopping $DESC: "\r
66     start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \\r
67         --exec $DAEMON\r
68     echo "$NAME."\r
69     ;;\r
70 restart|force-reload)\r
71     echo -n "Restarting $DESC: "\r
72     start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \\r
73         --exec $DAEMON\r
74     sleep 1\r
75     start-stop-daemon --background --start --quiet \\r
76         --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS\r
77     echo "$NAME."\r
78     ;;\r
79 *)\r
80     echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2\r
81     exit 1\r
82     ;;\r
83 esac\r
84 \r
85 exit 0