diff options
author | Vladimir Levijev <vladimir.levijev@zabbix.com> | 2012-06-11 17:16:23 +0400 |
---|---|---|
committer | Vladimir Levijev <vladimir.levijev@zabbix.com> | 2012-06-11 17:16:23 +0400 |
commit | 717ebc8ae6e970583d6f55a47a19fa08f38973ad (patch) | |
tree | 693408040d414c122df064671e4e4cbbd4cc6237 /misc | |
parent | d779f8c6516b704fd44ce04265ffe174e9bdd07f (diff) |
....I..... [ZBX-5058] improve scripts for Debian
These changes use --retry option of start-stop-daemon to wait till
process finishes. Also if stopping by pid file fails try stopping the
daemon by name and executable.
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/init.d/debian/zabbix-agent | 8 | ||||
-rwxr-xr-x | misc/init.d/debian/zabbix-server | 10 |
2 files changed, 7 insertions, 11 deletions
diff --git a/misc/init.d/debian/zabbix-agent b/misc/init.d/debian/zabbix-agent index 1c5d921c0dd..87253c36818 100755 --- a/misc/init.d/debian/zabbix-agent +++ b/misc/init.d/debian/zabbix-agent @@ -14,17 +14,15 @@ test -f $DAEMON || exit 0 case "$1" in start) echo "Starting $DESC: $NAME" - start-stop-daemon --oknodo --start --pidfile $PID \ - --exec $DAEMON + start-stop-daemon --start --oknodo --pidfile $PID --exec $DAEMON ;; stop) echo "Stopping $DESC: $NAME" - start-stop-daemon --oknodo --stop --pidfile $PID \ - --exec $DAEMON + start-stop-daemon --stop --quiet --pidfile $PID --retry=TERM/10/KILL/5 && return 0 + start-stop-daemon --stop --oknodo --exec $DAEMON --name $NAME --retry=TERM/10/KILL/5 ;; restart|force-reload) $0 stop - sleep 10 $0 start ;; *) diff --git a/misc/init.d/debian/zabbix-server b/misc/init.d/debian/zabbix-server index afa71d5b459..edb3a31ff92 100755 --- a/misc/init.d/debian/zabbix-server +++ b/misc/init.d/debian/zabbix-server @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # # Zabbix daemon start/stop script. # @@ -14,17 +14,15 @@ test -f $DAEMON || exit 0 case "$1" in start) echo "Starting $DESC: $NAME" - start-stop-daemon --oknodo --start --pidfile $PID \ - --exec $DAEMON + start-stop-daemon --start --oknodo --pidfile $PID --exec $DAEMON ;; stop) echo "Stopping $DESC: $NAME" - start-stop-daemon --oknodo --stop --pidfile $PID \ - --exec $DAEMON + start-stop-daemon --stop --quiet --pidfile $PID --retry=TERM/10/KILL/5 && return 0 + start-stop-daemon --stop --oknodo --exec $DAEMON --name $NAME --retry=TERM/10/KILL/5 ;; restart|force-reload) $0 stop - sleep 10 $0 start ;; *) |