[packages/chrony] - fix "status" in initscript (don't wait for sleep to finish)

hawk hawk at pld-linux.org
Sun Apr 28 22:42:54 CEST 2024


commit fe8a98e2a82658ff326a81b5dc446a1603066586
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Sun Apr 28 22:37:40 2024 +0200

    - fix "status" in initscript (don't wait for sleep to finish)

 chrony.spec  | 2 +-
 chronyd.init | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/chrony.spec b/chrony.spec
index 6e3fab5..1ada5cd 100644
--- a/chrony.spec
+++ b/chrony.spec
@@ -4,7 +4,7 @@ Summary:	An NTP client/server
 Summary(pl.UTF-8):	Klient/serwer NTP
 Name:		chrony
 Version:	4.5
-Release:	1
+Release:	2
 License:	GPL v2
 Group:		Daemons
 Source0:	http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
diff --git a/chronyd.init b/chronyd.init
index e4ff6e5..45d18ff 100755
--- a/chronyd.init
+++ b/chronyd.init
@@ -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'
 }
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/chrony.git/commitdiff/fe8a98e2a82658ff326a81b5dc446a1603066586



More information about the pld-cvs-commit mailing list