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"
16 pidfile=@-PKGRUNDIR-@/shibd.pid
17 lockfile=/var/lock/subsys/$prog
19 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
22 echo -n $"Starting $prog: "
23 if [ -f $lockfile ] ; then
24 if [ -f $pidfile ]; then
26 if checkpid $kpid 2>&1; then
27 echo "process already running"
30 echo "lock file found but no process running for pid $kpid, continuing"
35 # Make sure package run directory exists.
36 [ -d @-PKGRUNDIR-@ ] || mkdir @-PKGRUNDIR-@
38 export SHIBD_PID=$pidfile
40 chown $SHIBD_USER:$SHIBD_USER $pidfile
41 if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
42 /sbin/restorecon $pidfile
44 # Handle transition from root to non-root packages.
45 chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ 2>/dev/null || :
46 daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
50 [ $RETVAL -eq 0 ] && touch $lockfile
55 echo -n $"Stopping $prog: "
60 [ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
79 # run checks to determine if the service is running or use generic status
84 rh_status >/dev/null 2>&1
100 rh_status_q || exit 7
109 condrestart|try-restart)
110 rh_status_q || exit 0
114 echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"