[PATCH 1/9] init-d-script: fix PIDFILE argument to status_of_proc

Trek trek00 at inbox.ru
Fri Aug 28 07:20:58 BST 2020


The -p option was ignored as it was passed after the first
non-option argument. Moreover if PIDFILE is empty, status_of_proc
will find any process that matches DAEMON using pidof -x.

Closes: #962649
---
 debian/init-d-script | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/debian/init-d-script b/debian/init-d-script
index 212537fc..a977d7e2 100755
--- a/debian/init-d-script
+++ b/debian/init-d-script
@@ -155,9 +155,7 @@ do_reload_sigusr1() {
 }
 
 do_status() {
-	# FIXME: Does it make sense to call `status_of_proc' if PIDFILE is
-	# empty?
-	status_of_proc "$DAEMON" "$NAME" ${PIDFILE:="-p ${PIDFILE}"}
+	status_of_proc ${PIDFILE:+-p "$PIDFILE"} "$DAEMON" "$NAME"
 }
 
 if [ "$DEBUG" = "true" ] ; then
-- 
2.20.1




More information about the Debian-init-diversity mailing list