]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdcheck: make sure signals are processed immediately
authorMartin Wilck <mwilck@suse.com>
Wed, 13 Aug 2025 19:07:36 +0000 (21:07 +0200)
committerXiaoNi87 <xni@redhat.com>
Thu, 28 Aug 2025 07:49:34 +0000 (15:49 +0800)
"systemctl stop mdcheck_start.service" may hang for a long time,
because the shell doesn't handle signals until the sleep process in
the foreground returns. Fix this by starting sleep in the background
and waiting for it (the built-in "wait" receives the signal).

Signed-off-by: Martin Wilck <mwilck@suse.com>
misc/mdcheck

index aa2096612e560508bc4ed7796b7f4f49f343635e..398a1ea607ca44199a59790bacb977af89b89a9f 100644 (file)
@@ -172,5 +172,6 @@ do
                systemctl stop mdcheck_continue.timer
                exit 0;
        fi
-       sleep 220
+       sleep 220 &
+       wait $!
 done