2 # Author: Peter Schober <peter.schober@univie.ac.at> and many others
3 # based on shibd-debian (from Shibboleth's 1.3.1 SP source distribution)
4 # and SUSE's /etc/init.d/cyrus
10 # Required-Start: network
11 # Required-Stop: $null
13 # Short-Description: Shibboleth 2.x Service Provider Daemon
14 # Description: Starts the separate daemon used by the Shibboleth
15 # Apache module to manage state and SAML interactions.
19 DESC="Shibboleth 2 daemon"
21 SHIB_CONFIG=@-PKGSYSCONFDIR-@/shibboleth2.xml
22 DAEMON=@-PREFIX-@/sbin/$NAME
23 SCRIPTNAME=/etc/init.d/$NAME
24 PID_FILE=@-PKGRUNDIR-@/shibd.pid
27 # Force removal of socket
28 DAEMON_OPTS="$DAEMON_OPTS -f"
30 # Use defined configuration file
31 DAEMON_OPTS="$DAEMON_OPTS -c $SHIB_CONFIG"
33 # Specify pid file to use
34 DAEMON_OPTS="$DAEMON_OPTS -p $PID_FILE"
36 # Specify wait time to use
37 DAEMON_OPTS="$DAEMON_OPTS -w 30"
39 # Exit if the package is not installed.
40 test -x "$DAEMON" || exit 5
44 # First reset status of this service
49 echo -n "Starting $DESC ($NAME)"
50 ## Start daemon with startproc(8). If this fails
51 ## the echo return value is set appropriate.
53 # NOTE: startproc return 0, even if service is
54 # already running to match LSB spec.
55 /sbin/startproc -p $PID_FILE $DAEMON $DAEMON_OPTS > /dev/null 2>&1
57 # Remember status and be verbose
61 echo -n "Shutting down $DESC ($NAME)"
62 ## Stop daemon with killproc(8) and if this fails
63 ## set echo the echo return value.
65 /sbin/killproc -p $PID_FILE -TERM $DAEMON > /dev/null 2>&1
67 # Remember status and be verbose
71 ## Stop the service and if this succeeds (i.e. the
72 ## service was running before), start it again.
73 ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
74 $0 status >/dev/null && $0 restart
76 # Remember status and be quiet
80 ## Stop the service and regardless of whether it was
81 ## running or not, start it again.
85 # Remember status and be quiet
91 echo -n "Checking config for $DESC ($NAME): "
92 $DAEMON $DAEMON_OPTS -t
96 echo -n "Checking for service $DESC ($NAME)"
97 ## Check status with checkproc(8), if process is running
98 ## checkproc will return with exit status 0.
100 # Status has a slightly different for the status command:
101 # 0 - service running
102 # 1 - service dead, but /var/run/ pid file exists
103 # 2 - service dead, but /var/lock/ lock file exists
104 # 3 - service not running
106 # NOTE: checkproc returns LSB compliant status values.
107 /sbin/checkproc -p $PID_FILE $DAEMON
111 echo "Usage: $0 {start|stop|status|configtest|try-restart|restart}"