ShibbolethSP2InstallDebianLenny: shibd

File shibd, 2.3 kB (added by l.suhrbier, 2 years ago)

/etc/init.d/shibd

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