Use shibboleth-sp as package name for compatibility.
[shibboleth/cpp-sp.git] / configs / shibd-redhat.in
index 65295f2..6ac078b 100644 (file)
@@ -1,23 +1,40 @@
 #!/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
+SHIBD_UMASK=022
+SHIBD_WAIT=30
 prog=shibd
 pidfile=@-PKGRUNDIR-@/shibd.pid
 lockfile=/var/lock/subsys/$prog
 
 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
+umask $SHIBD_UMASK
+
 start() {
        echo -n $"Starting $prog: "
        if [ -f $lockfile ] ; then
@@ -38,12 +55,10 @@ start() {
        export SHIBD_PID=$pidfile
        touch $pidfile
        chown $SHIBD_USER:$SHIBD_USER $pidfile
-       if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
-               /sbin/restorecon $pidfile
-       fi
+
        # Handle transition from root to non-root packages.
-       chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ 2>/dev/null || :
-       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
+       chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ @-PKGCACHEDIR-@ 2>/dev/null || :
+       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w $SHIBD_WAIT
 
        RETVAL=$?
        echo