X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fstunnel4%2Ffiles%2Fetc-init.d-stunnel4;h=8921c4fef51e846521a8cd96dc56dc0f04235f18;hb=067090ebb5aafec7408e2a0676b857f8235ecbfc;hp=6456bfb7dca4ec523cbb748f204460319dcab107;hpb=d62d46d9cfde7b97002868dd10f822db3c6166b7;p=mirror%2Fdsa-puppet.git diff --git a/modules/stunnel4/files/etc-init.d-stunnel4 b/modules/stunnel4/files/etc-init.d-stunnel4 index 6456bfb7d..8921c4fef 100755 --- a/modules/stunnel4/files/etc-init.d-stunnel4 +++ b/modules/stunnel4/files/etc-init.d-stunnel4 @@ -76,10 +76,19 @@ killdaemons() { for file in $FILES; do PROCLIST=`get_pids $file` - if [ "$PROCLIST" ] && kill -0 $PROCLIST 2>/dev/null; then - kill $PROCLIST - echo -n "[stopped: $file] " - fi + for p in $PROCLIST; do + #start-stop-daemon --stop --retry 30 --pid "$p" + # start-stop-daemon in wheezy does not have a --pid yet, it interprets it as --pidfile + kill "$p" + c=150 + while [ "$c" -gt 0 ] && kill -0 "$p" 2> /dev/null ; do + sleep 0.20 + c=$((c - 1)) + [ "$((c % 5))" = 0 ] && echo -n . + done + if kill -0 "$p" 2> /dev/null; then kill -9 "$p"; fi + echo -n "[stopped: $file] " + done done } @@ -113,7 +122,7 @@ case "$1" in force-reload|restart) echo -n "Restarting $DESC: " killdaemons - sleep 5 + #sleep 5 startdaemons echo "$NAME." ;;