From a14a09b58d112f182db3243622323bd23666a659 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 4 Jul 2012 12:03:12 +0000 Subject: [PATCH] metaproxy.init: wait for MP to stop on SIGUSR1 Unfortunately, killproc utility silently ignores option -d when a any user signal is given, so we have to wait ourselves for the process to terminate. --- rpm/metaproxy.init | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/rpm/metaproxy.init b/rpm/metaproxy.init index 4e11c37..cf32a35 100755 --- a/rpm/metaproxy.init +++ b/rpm/metaproxy.init @@ -132,10 +132,28 @@ reload() { $DAEMON $OPTIONS -t >/dev/null 2>&1 RETVAL=$? if [ $RETVAL = 0 ]; then - killproc -p ${pidfile} -d 10 $DAEMON -USR1 + killproc -p ${pidfile} $DAEMON -USR1 >/dev/null 2>&1 RETVAL=$? - rm -f ${pidfile} + if [ $RETVAL = 0 ]; then + i=0 + p=`cat ${pidfile}` + while [ -d /proc/$p -a $i -lt 100 ]; do + i=`expr $i + 1` + usleep 50000 + done + if [ -d /proc/$p ]; then + echo_failure + rc_status -v + RETVAL=1 + else + rm -f ${pidfile} + fi + else + echo_failure + rc_status -v + fi else + echo_failure rc_status -v echo $"not reloading due to configuration syntax error" fi -- 1.7.10.4