Previously journalctl logs are directly dropped to save memory, but this make journalctl unusable in kdump kernel and diffcult to debug. So instead just don't let it read kmsg but keep other logs stored as volatile.
Kernel message are already stored in the kernel log ring buffer, no need to let journalctl make a copy, especially when in kdump kernel, ususlly there won't be too much kernel log overlapping the old ring buffer.
Signed-off-by: Kairui Song kasong@redhat.com --- dracut-module-setup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index b0b30af..42bef7a 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -799,13 +799,14 @@ kdump_install_systemd_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. + # Forward logs to console directly, and don't read Kmesg this + # avoids unneccessary memory consumption and make console output more useful. # Only do so for non fadump image. - if ! is_fadump_capable && [ "$failure_action" != "shell" ]; then + if ! is_fadump_capable; 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 + echo "Storage=volatile" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf + echo "ReadKMsg=no" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf fi }
在 2020年10月27日 15:21, Kairui Song 写道:
Previously journalctl logs are directly dropped to save memory, but this make journalctl unusable in kdump kernel and diffcult to debug. So instead just don't let it read kmsg but keep other logs stored as volatile.
Kernel message are already stored in the kernel log ring buffer, no need to let journalctl make a copy, especially when in kdump kernel, ususlly there won't be too much kernel log overlapping the old ring buffer.
This change looks more reasonable for kdump case.
Acked-by: Lianbo Jiang lijiang@redhat.com
Signed-off-by: Kairui Song kasong@redhat.com
dracut-module-setup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index b0b30af..42bef7a 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -799,13 +799,14 @@ kdump_install_systemd_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.
- # Forward logs to console directly, and don't read Kmesg this
- # avoids unneccessary memory consumption and make console output more useful. # Only do so for non fadump image.
- if ! is_fadump_capable && [ "$failure_action" != "shell" ]; then
- if ! is_fadump_capable; 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
echo "Storage=volatile" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
fiecho "ReadKMsg=no" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
}