From: Marc Fournier Date: Fri, 7 Nov 2014 16:37:40 +0000 (+0100) Subject: redhat initscript: add timeout when stopping the daemon X-Git-Tag: collectd-5.4.2~9 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=31246d467de836ac962ee65fa974e348a8fdd351;p=collectd.git redhat initscript: add timeout when stopping the daemon This mitigates the risk of having 2 daemons running simultaneously during a short period, on restart. The debian package's initscript does the same thing, using the same timeout value. --- diff --git a/contrib/redhat/init.d-collectd b/contrib/redhat/init.d-collectd index abdb168f..4c69f3c9 100644 --- a/contrib/redhat/init.d-collectd +++ b/contrib/redhat/init.d-collectd @@ -21,6 +21,8 @@ COLLECTD=/usr/sbin/collectd COLLECTDMONPIDDIR="/var/run" COLLECTDMONPID="$COLLECTDMONPIDDIR/collectdmon.pid" +MAXWAIT=30 + if [ -r /etc/sysconfig/$service ]; then . /etc/sysconfig/$service fi @@ -58,7 +60,7 @@ start () { } stop () { echo -n $"Stopping collectd: " - killproc -p $COLLECTDMONPID $prog + killproc -p $COLLECTDMONPID -d $MAXWAIT $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$service