From fd40c88f36efd57a2eb69f2773c213d8c729d5d5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 10 May 2012 12:59:03 +0200 Subject: [PATCH] RPM init.d script implements 'reload' using SIGUSR1 --- rpm/metaproxy.init | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/rpm/metaproxy.init b/rpm/metaproxy.init index d4cf0ab..74fcd68 100755 --- a/rpm/metaproxy.init +++ b/rpm/metaproxy.init @@ -126,9 +126,25 @@ stop() { RETVAL=$? [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } + reload() { - stop - start + echo -n $"Reloading $prog: " + $DAEMON $OPTIONS -t >/dev/null 2>&1 + RETVAL=$? + if [ $RETVAL = 0 ]; then + killproc -p ${pidfile} -d 10 $DAEMON -USR1 + RETVAL=$? + else + rc_status -v + echo $"not reloading due to configuration syntax error" + fi + if [ $RETVAL = 0 ]; then + daemon --pidfile ${pidfile} $DAEMON $OPTIONS -D -p ${pidfile} + rc_status -v + RETVAL=$? + [ $RETVAL = 0 ] && touch ${lockfile} + fi + return $RETVAL } # See how we were called. @@ -154,7 +170,9 @@ case "$1" in fi ;; reload) - reload + if [ -f ${pidfile} ] ; then + reload + fi ;; configtest) $DAEMON $OPTIONS -t -- 1.7.10.4