From: Adam Dickmeiss Date: Mon, 26 Jan 2015 15:07:11 +0000 (+0100) Subject: Debian : init.d metaproxy reload should check configuration MP-591 X-Git-Tag: v1.8.2~4 X-Git-Url: http://jira.indexdata.com/?a=commitdiff_plain;h=17f8ca9a9804a97ae18399940262e625291ce368;p=metaproxy-moved-to-github.git Debian : init.d metaproxy reload should check configuration MP-591 Fix logrotate too. That is logrotate will not rotate if configuration is faulty. --- diff --git a/debian/metaproxy.init b/debian/metaproxy.init index 67743dd..7c54cc9 100644 --- a/debian/metaproxy.init +++ b/debian/metaproxy.init @@ -88,7 +88,8 @@ do_reload() { # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. - # + + $DAEMON -t $DAEMON_OPTS > /dev/null || return 2 start-stop-daemon --stop --signal USR1 --quiet --retry=5 --pidfile $PIDFILE --name $NAME RETVAL="$?" # Return if daemon could not be stopped @@ -157,6 +158,10 @@ case "$1" in ;; esac ;; + checkconfig) + $DAEMON -t $DAEMON_OPTS > /dev/null || exit 2 + exit 0 + ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; diff --git a/debian/metaproxy.logrotate b/debian/metaproxy.logrotate index ae516f2..cb69b1a 100644 --- a/debian/metaproxy.logrotate +++ b/debian/metaproxy.logrotate @@ -5,6 +5,12 @@ compress delaycompress notifempty + prerotate + if [ -f /var/run/metaproxy.pid ]; then + /etc/init.d/metaproxy checkconfig > /dev/null + + fi + endscript postrotate if [ -f /var/run/metaproxy.pid ]; then /etc/init.d/metaproxy force-reload > /dev/null