public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] initscripts: Fix process check for processes with PID file
@ 2025-07-29 14:36 Michael Tremer
  0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2025-07-29 14:36 UTC (permalink / raw)
  To: development; +Cc: Michael Tremer

This check tests whether a process is still alive, but it fails for
those processes when we are using a PID file.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/initscripts/system/functions | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions
index 85eb3e975..c4b7cb39e 100644
--- a/src/initscripts/system/functions
+++ b/src/initscripts/system/functions
@@ -620,7 +620,11 @@ killproc()
 	done
 
 	if [ -z "${killsig}" ];	then
-		pidofproc -s "${1}"
+		if [ -z "${pidfile}" ];	then
+			pidofproc -s "${1}"
+		else
+			pidofproc -s -p "${pidfile}" "${1}"
+		fi
 
 		# Program was terminated
 		if [ "$?" != "0" ]; then
-- 
2.47.2



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-29 14:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-29 14:36 [PATCH] initscripts: Fix process check for processes with PID file Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox