X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=debian%2Fmetaproxy.init;h=adfdd8121c9d8f9353f1850f3ebac4eee451fc69;hb=79841cb0e1e5a4943da025ecd11b31a7cf8f7b2c;hp=1bbcfd7f5d19772c823d2fd24fba340090ac0c93;hpb=4e5866e906b8bea8ca01e62ca83af9aed9c794ff;p=metaproxy-moved-to-github.git diff --git a/debian/metaproxy.init b/debian/metaproxy.init index 1bbcfd7..adfdd81 100644 --- a/debian/metaproxy.init +++ b/debian/metaproxy.init @@ -88,11 +88,16 @@ do_reload() { # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. - # - start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME + + $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 + [ "$RETVAL" = 2 ] && return 2 + # daemon not running or stopped + rm -f $PIDFILE + # Return if it was not running, in which case we don't start it [ "$RETVAL" = 1 ] && return 0 - [ "$RETVAL" != 0 ] && return $RETVAL start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_OPTS \ || return 2 @@ -127,9 +132,15 @@ case "$1" in # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # - log_daemon_msg "Reloading $DESC" "$NAME" - do_reload - log_end_msg $? + # our reload makes a new PID. systemd doesn't allow it. MP-620 + if test -n "$_use_systemctl"; then + log_daemon_msg "Using systemd. Not reloading $DESC" "$NAME" + log_end_msg 0 + else + log_daemon_msg "Reloading $DESC" "$NAME" + do_reload + log_end_msg $? + fi ;; restart) # @@ -153,8 +164,15 @@ case "$1" in ;; esac ;; + checkconfig) + $DAEMON -t $DAEMON_OPTS > /dev/null || exit 2 + exit 0 + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; *) - echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2 exit 3 ;; esac