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 # Exit if the package is not installed.
37 test -x "$DAEMON" || exit 5
41 # First reset status of this service
46 echo -n "Starting $DESC ($NAME)"
47 ## Start daemon with startproc(8). If this fails
48 ## the echo return value is set appropriate.
50 # NOTE: startproc return 0, even if service is
51 # already running to match LSB spec.
52 /sbin/startproc -p $PID_FILE $DAEMON $DAEMON_OPTS > /dev/null 2>&1
54 # Remember status and be verbose
58 echo -n "Shutting down $DESC ($NAME)"
59 ## Stop daemon with killproc(8) and if this fails
60 ## set echo the echo return value.
62 /sbin/killproc -p $PID_FILE -TERM $DAEMON > /dev/null 2>&1
64 # Remember status and be verbose
68 ## Stop the service and if this succeeds (i.e. the
69 ## service was running before), start it again.
70 ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
71 $0 status >/dev/null && $0 restart
73 # Remember status and be quiet
77 ## Stop the service and regardless of whether it was
78 ## running or not, start it again.
82 # Remember status and be quiet
88 echo -n "Checking config for $DESC ($NAME): "
89 $DAEMON $DAEMON_OPTS -t
93 echo -n "Checking for service $DESC ($NAME)"
94 ## Check status with checkproc(8), if process is running
95 ## checkproc will return with exit status 0.
97 # Status has a slightly different for the status command:
99 # 1 - service dead, but /var/run/ pid file exists
100 # 2 - service dead, but /var/lock/ lock file exists
101 # 3 - service not running
103 # NOTE: checkproc returns LSB compliant status values.
104 /sbin/checkproc -p $PID_FILE $DAEMON
108 echo "Usage: $0 {start|stop|status|configtest|try-restart|restart}"