Attempt to fix SUSE 11.2 build by reordering lib flags in log4shib test.
[shibboleth/sp.git] / configs / shibd-redhat.in
index cafe481..04dc659 100644 (file)
@@ -14,8 +14,13 @@ shibd="@-PREFIX-@/sbin/shibd"
 SHIBD_USER=root
 pidfile=@-PKGRUNDIR-@/shibd.pid
 prog=shibd
+#VER=`cat /etc/redhat-release | awk '{print $3}' | awk -F . '{print $1}'`
 RETVAL=0
 
+if [ -f /etc/sysconfig/shibd ] ; then
+    . /etc/sysconfig/shibd
+fi
+
 start() {
        echo -n $"Starting $prog: "
        if [ -f /var/lock/subsys/shibd ] ; then
@@ -24,7 +29,7 @@ start() {
                        if checkpid $kpid 2>&1; then
                                echo "process already running"
                                        return -1
-                       else
+                               else
                                        echo "lock file found but no process running for pid $kpid, continuing"
                        fi
                fi
@@ -36,8 +41,7 @@ start() {
        if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
                /sbin/restorecon $pidfile
        fi
-       # daemon function just hangs, so I'm using su directly
-       su - $SHIBD_USER -c "$shibd -p $pidfile -f"
+       daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
 
        RETVAL=$?
        echo
@@ -47,12 +51,7 @@ start() {
 
 stop() {
        echo -n $"Stopping $prog: "
-       if [ -f $pidfile ]; then
-               read kpid < $pidfile
-               kill $kpid
-       else
-           killproc shibd
-       fi
+       killproc shibd
 
        RETVAL=$?
        echo
@@ -68,7 +67,7 @@ case "$1" in
        stop
        ;;
   status)
-        status $shibd
+       status $shibd
        RETVAL=$?
        ;;
   restart)
@@ -77,7 +76,7 @@ case "$1" in
        start
        ;;
   *)
-       echo $"Usage: $prog {start|stop|restart}"
+       echo $"Usage: $prog {start|stop|status|restart}"
        exit 1
 esac