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 <kasong(a)redhat.com>
---
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
--
2.26.2