Subject: bug#599: initscripts: typo in /etc/init.d/sendsigs (easy fix)

From: Jerome BENOIT <[email-masked]>
Date: Sat, 7 Aug 2021 22:51:02 +0200

On Sat, 7 Aug 2021 19:23:56 +0100 Mark Hindley <[email-masked]> wrote:
> Control: tags -1 moreinfo

Actually I think that my first fix was actually incorrect.

Please find in attachment the current version, "my" current version, and
the corresponding patch.

I think that otherwise these loops make no sense.

Cheers,
Jerome
--- sendsigs-dpkg-dist-with_typo	2019-02-26 17:59:47.000000000 +0100
+++ sendsigs	2021-08-07 22:45:52.619263748 +0200
@@ -27,8 +27,8 @@
 do_stop () {
 	OMITPIDS=
 
-	for omitfile in /run/sendsigs.omit; do
-		if [ -e $omitfile ]; then
+	for omitfile in /run/sendsigs.omit.d/*; do
+		if [ -f $omitfile ]; then
 			for pid in $(cat $omitfile); do
 				OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
 			done
@@ -38,7 +38,7 @@
 	# Load sendsigs.omit.d/packagename files too, to make it
 	# possible for scripts that need to modify the list of pids at
 	# run time without race conditions.
-	for omitdir in /run/sendsigs.omit.d; do
+	for omitdir in /run/sendsigs.omit.d/*; do
 		if [ -d "${omitdir}" ]; then
 			for pidfile in "${omitdir}/"*; do
 				[ -f "$pidfile" ] || continue