]> git.pld-linux.org Git - packages/chrony.git/blobdiff - chronyd.init
- fix "status" in initscript (don't wait for sleep to finish)
[packages/chrony.git] / chronyd.init
index e4ff6e5ec0e2c69825097c1e9e12f7b0b1d82f75..45d18ff46e6c09dd7b4c951c2db16ceee79d8ce9 100755 (executable)
@@ -40,13 +40,13 @@ $1
 EOF
         chronycpid=$!
 
-        # chronyc will hang if the daemon doesn't respond, kill it after 3 s
-               #'
+        # chronyc will hang if the daemon doesn't respond, kill it after 3s
         (sleep 3; kill $chronycpid) < /dev/null > /dev/null 2>&1 &
         killerpid=$!
 
         wait $chronycpid >/dev/null 2>&1
-        kill $killerpid >/dev/null 2>&1 || echo "chronyd not responding"
+        # kill also $killerpid children processes to avoid waiting for "sleep" to finish
+        kill $killerpid $(cat /proc/$killerpid/task/$killerpid/children) >/dev/null 2>&1 || echo "chronyd not responding"
     ) | grep -v '200 OK'
 }
 
This page took 0.04647 seconds and 4 git commands to generate.