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 acceptable.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-module-setup.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 5222040..27b9f02 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
}
--
2.21.0
Show replies by thread