From 31246d467de836ac962ee65fa974e348a8fdd351 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Fri, 7 Nov 2014 17:37:40 +0100 Subject: [PATCH] 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. --- contrib/redhat/init.d-collectd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.11.0