]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
99memstrack: hook script should not call exit
authorKairui Song <kasong@redhat.com>
Wed, 27 May 2020 14:07:37 +0000 (22:07 +0800)
committerLukáš Nykrýn <lnykryn@redhat.com>
Wed, 27 May 2020 14:51:52 +0000 (16:51 +0200)
With memstrack module, rd.break may not work because the hook scripts
are sourced, not executed, so the exit call will make pre-pivot queue
exit early. See 98dracut-systemd/dracut-pre-pivot.sh, everything after
"source_hook cleanup" will be ignored.

Replace with return instead.

Credits go to Lukas Nykryn <lnykryn@redhat.com> who helped discover and
debug this issue.

Signed-off-by: Kairui Song <kasong@redhat.com>
modules.d/99memstrack/memstrack-report.sh

index 241e862178803f0902ce3a22d214b1b11f961db7..3de55bd105c5342e581654c88400321be4c6be19 100755 (executable)
@@ -2,7 +2,7 @@
 . /lib/dracut-lib.sh
 
 if ! [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then
-    exit 0
+    return 0
 fi
 
 if type -P systemctl >/dev/null; then