From 5b26c1f8b23f19d523fca27f1b75c5fa4973615b Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Fri, 28 Jun 2019 21:44:03 +0800 Subject: [PATCH] Forward logs in kdump kernel to console directly Don't use any log storage and forward to console directly, this make console output more useful, and also save more memory. On a fresh installed Fedora 30 it saved ~5M of memory, and the amount of log being printed to console is still accetable. Signed-off-by: Kairui Song Acked-by: Dave Young --- dracut-module-setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 2998c72..07200b7 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -822,4 +822,11 @@ install() { echo "[Manager]" > ${initdir}/etc/systemd/system.conf.d/kdump.conf echo "DefaultTimeoutStartSec=300s" >> ${initdir}/etc/systemd/system.conf.d/kdump.conf fi + + # Forward logs to console directly, this avoids unneccessary memory + # consumption and make console output more useful + 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 + echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf }