[cpp-sp COMMIT] in /branches/REL_2: configs/shibd-redhat.in configs/shibd-suse.in plugins/GSSAPIAttributeExtractor.cp...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Aug 25 01:26:07 BST 2011
Author: scantor
Date: Thu Aug 25 01:26:06 2011
New Revision: 3511
URL: http://svn.shibboleth.net/view/cpp-sp?rev=3511&view=rev
Log:
https://issues.shibboleth.net/jira/browse/SSPCPP-353
Modified:
branches/REL_2/configs/shibd-redhat.in
branches/REL_2/configs/shibd-suse.in
branches/REL_2/plugins/GSSAPIAttributeExtractor.cpp
branches/REL_2/plugins/internal.h
branches/REL_2/plugins/plugins.cpp
branches/REL_2/shibboleth.spec.in
Modified: branches/REL_2/configs/shibd-redhat.in
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/configs/shibd-redhat.in?rev=3511&r1=3510&r2=3511&view=diff
==============================================================================
--- branches/REL_2/configs/shibd-redhat.in (original)
+++ branches/REL_2/configs/shibd-redhat.in Thu Aug 25 01:26:06 2011
@@ -12,30 +12,26 @@
. /etc/rc.d/init.d/functions
shibd="@-PREFIX-@/sbin/shibd"
SHIBD_USER=root
+prog=shibd
pidfile=@-PKGRUNDIR-@/shibd.pid
-prog=shibd
-#VER=`cat /etc/redhat-release | awk '{print $3}' | awk -F . '{print $1}'`
-RETVAL=0
+lockfile=/var/lock/subsys/$prog
-if [ -f /etc/sysconfig/shibd ] ; then
- . /etc/sysconfig/shibd
-fi
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
echo -n $"Starting $prog: "
- if [ -f /var/lock/subsys/shibd ] ; then
+ if [ -f $lockfile ] ; then
if [ -f $pidfile ]; then
read kpid < $pidfile
if checkpid $kpid 2>&1; then
echo "process already running"
- return -1
+ return 1;
else
echo "lock file found but no process running for pid $kpid, continuing"
fi
fi
fi
-#_RHEL6_ export LD_LIBRARY_PATH=/opt/shibboleth/lib:$LD_LIBRARY_PATH
export SHIBD_PID=$pidfile
touch $pidfile
chown $SHIBD_USER:$SHIBD_USER $pidfile
@@ -43,12 +39,12 @@
/sbin/restorecon $pidfile
fi
# Handle transition from root to non-root packages.
- chown $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@/*
+ chown $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@/* 2>/dev/null || :
daemon --user $SHIBD_USER $shibd -p $pidfile -f -w 30
RETVAL=$?
echo
- [ $RETVAL = 0 ] && touch /var/lock/subsys/shibd
+ [ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
@@ -58,29 +54,62 @@
RETVAL=$?
echo
- [ $RETVAL = 0 ] && rm -f /var/lock/subsys/shibd $pidfile
+ [ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
+ return $RETVAL
}
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status $shibd
- RETVAL=$?
- ;;
- restart)
+restart() {
stop
sleep 5
start
- ;;
- *)
- echo $"Usage: $prog {start|stop|status|restart}"
- exit 1
+}
+
+reload() {
+ restart
+}
+
+force_reload() {
+ restart
+}
+
+rh_status() {
+ # run checks to determine if the service is running or use generic status
+ status $prog
+}
+
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+ rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ reload)
+ rh_status_q || exit 7
+ $1
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ status)
+ rh_status
+ ;;
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 2
esac
-exit $RETVAL
+exit $?
Modified: branches/REL_2/configs/shibd-suse.in
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/configs/shibd-suse.in?rev=3511&r1=3510&r2=3511&view=diff
==============================================================================
--- branches/REL_2/configs/shibd-suse.in (original)
+++ branches/REL_2/configs/shibd-suse.in Thu Aug 25 01:26:06 2011
@@ -26,21 +26,20 @@
PID_FILE=@-PKGRUNDIR-@/shibd.pid
SHIBD_USER=root
DAEMON_OPTS=""
-
+
# Force removal of socket
DAEMON_OPTS="$DAEMON_OPTS -f"
# Use defined configuration file
DAEMON_OPTS="$DAEMON_OPTS -c $SHIB_CONFIG"
-
-# Set uid to run as
-DAEMON_OPTS="$DAEMON_OPTS -u $SHIBD_USER"
# Specify pid file to use
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
# Exit if the package is not installed.
test -x "$DAEMON" || exit 5
@@ -52,8 +51,8 @@
case "$1" in
start)
- # Handle transition from root to non-root packages.
- chown $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@/*
+ # Handle transition from root to non-root packages.
+ chown $SHIBD_USER:$SHIBD_USER @-PKGRUNDIR-@/* 2>/dev/null || :
echo -n "Starting $DESC ($NAME)"
## Start daemon with startproc(8). If this fails
@@ -61,7 +60,7 @@
# NOTE: startproc return 0, even if service is
# already running to match LSB spec.
- /sbin/startproc -p $PID_FILE $DAEMON $DAEMON_OPTS > /dev/null 2>&1
+ /sbin/startproc -u $SHIBD_USER -p $PID_FILE $DAEMON $DAEMON_OPTS > /dev/null 2>&1
# Remember status and be verbose
rc_status -v
Modified: branches/REL_2/plugins/GSSAPIAttributeExtractor.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/plugins/GSSAPIAttributeExtractor.cpp?rev=3511&r1=3510&r2=3511&view=diff
[... 236 lines stripped ...]
More information about the commits
mailing list