SSPCPP-654 - Move fork wait timeout from init script to sysconfig
authorScott Cantor <cantor.2@osu.edu>
Thu, 2 Jul 2015 00:27:48 +0000 (00:27 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 2 Jul 2015 00:27:48 +0000 (00:27 +0000)
configs/shibd-amazon.in
configs/shibd-debian.in
configs/shibd-redhat.in
configs/shibd-suse.in
shibboleth.spec.in

index c4fb2ca..6ac078b 100644 (file)
@@ -26,6 +26,7 @@
 shibd="@-PREFIX-@/sbin/shibd"
 SHIBD_USER=root
 SHIBD_UMASK=022
+SHIBD_WAIT=30
 prog=shibd
 pidfile=@-PKGRUNDIR-@/shibd.pid
 lockfile=/var/lock/subsys/$prog
@@ -57,7 +58,7 @@ start() {
 
        # Handle transition from root to non-root packages.
        chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ @-PKGCACHEDIR-@ 2>/dev/null || :
-       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
+       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w $SHIBD_WAIT
 
        RETVAL=$?
        echo
index 59f0995..37efca4 100644 (file)
@@ -24,12 +24,16 @@ DESC="Shibboleth 2 daemon"
 NAME=shibd
 SHIB_HOME=@-PREFIX-@
 SHIBSP_CONFIG=@-PKGSYSCONFDIR-@/shibboleth2.xml
+SHIBD_WAIT=30
 LD_LIBRARY_PATH=@-PREFIX-@/lib
 DAEMON=@-PREFIX-@/sbin/$NAME
 SCRIPTNAME=/etc/init.d/$NAME
 PIDFILE=@-PKGRUNDIR-@/$NAME.pid
 DAEMON_OPTS=""
 
+# Read configuration if it is present.
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
 # Force removal of socket
 DAEMON_OPTS="$DAEMON_OPTS -f"
 
@@ -40,14 +44,11 @@ DAEMON_OPTS="$DAEMON_OPTS -c $SHIBSP_CONFIG"
 DAEMON_OPTS="$DAEMON_OPTS -p $PIDFILE"
 
 # Specify wait time to use
-DAEMON_OPTS="$DAEMON_OPTS -w 30"
+DAEMON_OPTS="$DAEMON_OPTS -w $SHIBD_WAIT"
 
 # Exit if the package is not installed.
 [ -x "$DAEMON" ] || exit 0
 
-# Read configuration if it is present.
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
 # Get the setting of VERBOSE and other rcS variables.
 [ -f /etc/default/rcS ] && . /etc/default/rcS
 
index c4fb2ca..6ac078b 100644 (file)
@@ -26,6 +26,7 @@
 shibd="@-PREFIX-@/sbin/shibd"
 SHIBD_USER=root
 SHIBD_UMASK=022
+SHIBD_WAIT=30
 prog=shibd
 pidfile=@-PKGRUNDIR-@/shibd.pid
 lockfile=/var/lock/subsys/$prog
@@ -57,7 +58,7 @@ start() {
 
        # Handle transition from root to non-root packages.
        chown -R $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@ @-PKGCACHEDIR-@ 2>/dev/null || :
-       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
+       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w $SHIBD_WAIT
 
        RETVAL=$?
        echo
index 411f20e..d0bc01b 100644 (file)
@@ -26,8 +26,11 @@ SCRIPTNAME=/etc/init.d/$NAME
 PID_FILE=@-PKGRUNDIR-@/shibd.pid
 SHIBD_USER=root
 SHIBD_UMASK=022
+SHIBD_WAIT=30
 DAEMON_OPTS=""
 
+[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
+
 # Force removal of socket
 DAEMON_OPTS="$DAEMON_OPTS -f"
  
@@ -38,9 +41,7 @@ DAEMON_OPTS="$DAEMON_OPTS -c $SHIB_CONFIG"
 DAEMON_OPTS="$DAEMON_OPTS -p $PID_FILE"
 
 # Specify wait time to use
-DAEMON_OPTS="$DAEMON_OPTS -w 30"
-
-[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
+DAEMON_OPTS="$DAEMON_OPTS -w $SHIBD_WAIT"
 
 umask $SHIBD_UMASK
 
index 065376f..03cb83e 100644 (file)
@@ -169,6 +169,12 @@ if [ "$SYSCONFIG_SHIBD" != "no" ] ; then
 
 # User account for shibd
 SHIBD_USER=%{runuser}
+
+# Umask for shibd
+# SHIBD_UMASK=022
+
+# Wait period (secs) for configuration (and metadata) to load
+SHIBD_WAIT=30
 EOF
        %if 0%{?rhel} >= 6 || 0%{?centos_version} >= 600 || 0%{?amzn} >= 1
                cat >> $SYSCONFIG_SHIBD <<EOF