From 041ba89902961b5490a7143d9596dc00d732cba0 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Tue, 11 Aug 2020 17:50:08 +0800 Subject: [PATCH] Don't drop journalctl content if failure action is "shell" If failure action is set to "shell", user will need more debug info available in kdump kernel. Especially when serial console is not available, manually retrieve the log from journalctl is very useful for debugging kdump issue. Else, we can still drop journalctl content to save memory assuming nothing will use it. Signed-off-by: Kairui Song Acked-by: Lianbo Jiang --- dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3c35aa2..a186570 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -788,6 +788,8 @@ kdump_install_random_seed() { } kdump_install_systemd_conf() { + local failure_action=$(get_option_value "failure_action") + # Kdump turns out to require longer default systemd mount timeout # than 1st kernel(90s by default), we use default 300s for kdump. grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null @@ -800,7 +802,7 @@ kdump_install_systemd_conf() { # Forward logs to console directly, this avoids unneccessary memory # consumption and make console output more useful. # Only do so for non fadump image. - if ! is_fadump_capable; then + if ! is_fadump_capable && [ "$failure_action" != "shell" ]; then mkdir -p ${initdir}/etc/systemd/journald.conf.d echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "Storage=none" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf