3 # Startup script for the Shibboleth Service Provider Daemon
6 # description: Shibboleth 2 Service Provider Daemon
8 # pidfile: @-PKGRUNDIR-@/shibd.pid
9 # config: @-PKGSYSCONFDIR-@/shibboleth2.xml
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13 shibd="@-PREFIX-@/sbin/shibd"
15 pidfile=@-PKGRUNDIR-@/shibd.pid
17 VER=`cat /etc/redhat-release | awk '{print $3}' | awk -F . '{print $1}'`
21 echo -n $"Starting $prog: "
22 if [ -f /var/lock/subsys/shibd ] ; then
23 if [ -f $pidfile ]; then
25 if checkpid $kpid 2>&1; then
26 echo "process already running"
29 echo "lock file found but no process running for pid $kpid, continuing"
34 export SHIBD_PID=$pidfile
36 chown $SHIBD_USER:$SHIBD_USER $pidfile
37 if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
38 /sbin/restorecon $pidfile
40 if [ 5 -le $VER ] ; then
41 daemon --user $SHIBD_USER --pidfile $pidfile $shibd -p $pidfile -f -w 30
43 daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
48 [ $RETVAL = 0 ] && touch /var/lock/subsys/shibd
53 echo -n $"Stopping $prog: "
54 if [ -f $pidfile -a 5 -le $VER ] ; then
55 killproc -p $pidfile shibd
62 [ $RETVAL = 0 ] && rm -f /var/lock/subsys/shibd $pidfile
65 # See how we were called.
83 echo $"Usage: $prog {start|stop|status|restart}"