]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-initqueue: Print more useful info in case of timeout
authorKairui Song <kasong@redhat.com>
Fri, 2 Aug 2019 09:11:19 +0000 (17:11 +0800)
committerDaniel Molkentin <daniel@molkentin.de>
Tue, 4 Aug 2020 12:00:06 +0000 (14:00 +0200)
Currently when initqueue timeout, it span the console with
"dracut-initqueue timeout - starting timeout scripts", which isn't very
helpful as we still don't know what actually happened. Try to improve
this by print what is actually being waited.

Besides, only print "starting timeout scripts" when there are
actual timeout scripts to use.

Signed-off-by: Kairui Song <kasong@redhat.com>
modules.d/98dracut-systemd/dracut-initqueue.sh

index 3ddc2362eac2981545fe61ec63438bbb489c7c65..89225995ba2a7c7b63c864c61a7636b0cdb9ea36 100755 (executable)
@@ -55,14 +55,20 @@ while :; do
     done
 
     if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then
-        warn "dracut-initqueue timeout - starting timeout scripts"
-        for job in $hookdir/initqueue/timeout/*.sh; do
-            [ -e "$job" ] || break
-            job=$job . $job
-            udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0
-            [ -f $hookdir/initqueue/work ] && main_loop=0
-            [ $main_loop -eq 0 ] && break
+        warn "dracut-initqueue: timeout, still waiting for following initqueue hooks:"
+        for _f in $hookdir/initqueue/finished/*.sh; do
+            warn "$_f: \"$(cat "$_f")\""
         done
+        if [ "$(ls -A $hookdir/initqueue/finished)" ]; then
+            warn "dracut-initqueue: starting timeout scripts"
+            for job in $hookdir/initqueue/timeout/*.sh; do
+                [ -e "$job" ] || break
+                job=$job . $job
+                udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0
+                [ -f $hookdir/initqueue/work ] && main_loop=0
+                [ $main_loop -eq 0 ] && break
+            done
+        fi
     fi
 
     main_loop=$(($main_loop+1))