X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=rpm%2Fmetaproxy.init;h=74fcd68a5e5a1199c799be3cb075c9412e697eee;hb=fd40c88f36efd57a2eb69f2773c213d8c729d5d5;hp=d4cf0ab201f9d79156ee85ccfb5f6157b595eb7a;hpb=8e494be7d760b4fe8f5b0d9e48a19b2dca7d962b;p=metaproxy-moved-to-github.git 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