#!/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
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 || :
+ chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ @-PKGCACHEDIR-@ 2>/dev/null || :
daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
+ # Adjust native logging directory permission so log roll-over works
+ chown apache:apache @-SHIRELOGDIR-@
+
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile