Use start-stop-daemon for stopping/restarting stunnel4
authorTollef Fog Heen <tfheen@err.no>
Mon, 6 Apr 2015 17:28:03 +0000 (19:28 +0200)
committerTollef Fog Heen <tfheen@err.no>
Mon, 6 Apr 2015 17:28:03 +0000 (19:28 +0200)
modules/stunnel4/files/etc-init.d-stunnel4

index 6456bfb..7bc871a 100755 (executable)
@@ -76,9 +76,9 @@ 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] "
+    for p in $PROCLIST; do
+      start-stop-daemon --stop --retry 30 --pid "$p"
+      echo -n "[stopped: $file] "
     fi
   done
 }