Merge commit '2.5.0' into moonshot-packaging-fixes
[shibboleth/sp.git] / configs / shibd-redhat.in
index 716bdbd..ee536cb 100644 (file)
@@ -1,15 +1,28 @@
 #!/bin/bash
 #
-# Startup script for the Shibboleth Service Provider Daemon
+# shibd Shibboleth Service Provider Daemon
 #
-# chkconfig: - 98 02
+# chkconfig: - 80 20
 # description: Shibboleth 2 Service Provider Daemon
 # processname: shibd
 # pidfile: @-PKGRUNDIR-@/shibd.pid
 # config: @-PKGSYSCONFDIR-@/shibboleth2.xml
 
+### BEGIN INIT INFO
+# Provides: shibd
+# Required-Start: $local_fs $remote_fs $network
+# Should-Start: $time
+# Should-Stop: $time
+# Required-Stop: $local_fs $remote_fs $network
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6 
+# Short-Description: Shibboleth 2 Service Provider Daemon
+# Description: Starts the separate daemon used by the Shibboleth Apache module to manage state and SAML interactions.
+### END INIT INFO
+
 # Source function library.
 . /etc/rc.d/init.d/functions
+
 shibd="@-PREFIX-@/sbin/shibd"
 SHIBD_USER=root
 prog=shibd
@@ -32,6 +45,9 @@ start() {
                fi
        fi
 
+       # Make sure package run directory exists.
+       [ -d @-PKGRUNDIR-@ ] || mkdir @-PKGRUNDIR-@
+
        export SHIBD_PID=$pidfile
        touch $pidfile
        chown $SHIBD_USER:$SHIBD_USER $pidfile
@@ -39,7 +55,7 @@ start() {
                /sbin/restorecon $pidfile
        fi
        # Handle transition from root to non-root packages.
-       chown $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@/* 2>/dev/null || :
+       chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ 2>/dev/null || :
        daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
 
        RETVAL=$?