Package: sysvinit-utils
Version: 2.88dsf-59.3
Control: tags -1 patch

the fix for #822674 had a caveat, because status_of_proc cannot parse
options after the first non-option argument, as it uses getopts

a simple test, where /run/crond.pid contains a running pid:

  $ . /lib/lsb/init-functions
  $ status_of_proc -p /run/crond.pid /non/existant/filename name
  [ ok ] name is running.
  $ status_of_proc /non/existant/filename name -p /run/crond.pid
  [FAIL] name is not running ... failed!


usually it works because it checks the command name only, omitting the
pidfile check at all:

  $ status_of_proc /usr/sbin/cron name -p /non/existant/filename
  [ ok ] name is running.


please see the attached patch

ciao!
diff --git a/debian/init-d-script b/debian/init-d-script
index 212537fc..f5388af9 100755
--- a/debian/init-d-script
+++ b/debian/init-d-script
@@ -157,7 +157,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

Reply via email to