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 <kasong@redhat.com>
Acked-by: Lianbo Jiang <lijiang@redhat.com>
This commit is contained in:
Kairui Song 2020-08-11 17:50:08 +08:00
parent bcaa4358b1
commit 041ba89902

View File

@ -788,6 +788,8 @@ kdump_install_random_seed() {
} }
kdump_install_systemd_conf() { kdump_install_systemd_conf() {
local failure_action=$(get_option_value "failure_action")
# Kdump turns out to require longer default systemd mount timeout # Kdump turns out to require longer default systemd mount timeout
# than 1st kernel(90s by default), we use default 300s for kdump. # than 1st kernel(90s by default), we use default 300s for kdump.
grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null 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 # Forward logs to console directly, this avoids unneccessary memory
# consumption and make console output more useful. # consumption and make console output more useful.
# Only do so for non fadump image. # 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 mkdir -p ${initdir}/etc/systemd/journald.conf.d
echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf
echo "Storage=none" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "Storage=none" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf