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
14 # Short-Description: Shibboleth 2.x Service Provider Daemon
15 # Description: Starts the separate daemon used by the Shibboleth
16 # Apache module to manage state and SAML interactions.
20 DESC="Shibboleth 2 daemon"
22 SHIB_CONFIG=@-PKGSYSCONFDIR-@/shibboleth2.xml
23 DAEMON=@-PREFIX-@/sbin/$NAME
24 SCRIPTNAME=/etc/init.d/$NAME
25 PID_FILE=@-PKGRUNDIR-@/shibd.pid
28 # Force removal of socket
29 DAEMON_OPTS="$DAEMON_OPTS -f"
31 # Use defined configuration file
32 DAEMON_OPTS="$DAEMON_OPTS -c $SHIB_CONFIG"
34 # Specify pid file to use
35 DAEMON_OPTS="$DAEMON_OPTS -p $PID_FILE"
37 # Exit if the package is not installed.
38 test -x "$DAEMON" || exit 5
42 # First reset status of this service
47 echo -n "Starting $DESC ($NAME)"
48 ## Start daemon with startproc(8). If this fails
49 ## the echo return value is set appropriate.
51 # NOTE: startproc return 0, even if service is
52 # already running to match LSB spec.
53 /sbin/startproc -p $PID_FILE $DAEMON $DAEMON_OPTS > /dev/null 2>&1
55 # Remember status and be verbose
59 echo -n "Shutting down $DESC ($NAME)"
60 ## Stop daemon with killproc(8) and if this fails
61 ## set echo the echo return value.
63 /sbin/killproc -p $PID_FILE -TERM $DAEMON > /dev/null 2>&1
65 # Remember status and be verbose
69 ## Stop the service and if this succeeds (i.e. the
70 ## service was running before), start it again.
71 ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
72 $0 status >/dev/null && $0 restart
74 # Remember status and be quiet
78 ## Stop the service and regardless of whether it was
79 ## running or not, start it again.
83 # Remember status and be quiet
89 echo -n "Checking config for $DESC ($NAME): "
90 $DAEMON $DAEMON_OPTS -t
94 echo -n "Checking for service $DESC ($NAME)"
95 ## Check status with checkproc(8), if process is running
96 ## checkproc will return with exit status 0.
98 # Status has a slightly different for the status command:
100 # 1 - service dead, but /var/run/ pid file exists
101 # 2 - service dead, but /var/lock/ lock file exists
102 # 3 - service not running
104 # NOTE: checkproc returns LSB compliant status values.
105 /sbin/checkproc -p $PID_FILE $DAEMON
109 echo "Usage: $0 {start|stop|status|configtest|try-restart|restart}"