Systemd/tmpfiles.d/systemd-pstore.conf
Kairui Song edb8c98446 pstore: don't enable crash_kexec_post_notifiers by default
commit f00c36641a enabled
crash_kexec_post_notifiers by default regardless of whether pstore
is enabled or not.

The original intention to enabled this option by default is that
it only affects kernel post-panic behavior, so should have no harm.
But this is not true if the user wants a reliable kdump.

crash_kexec_post_notifiers is known to cause problem with kdump,
and it's documented in kernel. It's not easy to fix the problem
because of how kdump works. Kdump expects the crashed kernel to
jump to an pre-loaded crash kernel, so doing any extra job before
the jump will increase the risk.

It depends on the user to choose between having a reliable kdump or
some other post-panic debug mechanic.

So it's better to keep this config untouched by default, or it may put
kdump at higher risk of failing silently. User should enable it by
uncommenting the config line manually if pstore is always needed.

Also add a inline comment inform user about the potential issue.

Thanks to Dave Young for finding out this issue.

Fixes #16661

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-22 11:17:39 +02:00

35 lines
1.5 KiB
Plaintext

# SPDX-License-Identifier: LGPL-2.1+
#
# The systemd-pstore.service(1) archives the contents of /sys/fs/pstore
# upon boot so that there is room for a subsequent dump. This service
# is enabled with:
# systemctl enable systemd-pstore
#
# With the service enabled, the kernel still needs to be configured
# to write data into the pstore. The kernel has two parameters,
# crash_kexec_post_notifiers and printk.always_kmsg_dump, that
# control writes into pstore.
#
# The crash_kexec_post_notifiers parameter enables the kernel to write
# dmesg (including stack trace) into pstore upon a panic even if kdump
# is loaded, only needed if you want to use pstore with kdump. Without
# this parameter, kdump could block writing to pstore for stability
# reason. Note this increases the risk of kdump failure even if pstore
# is not available.
#
# The printk.always_kmsg_dump parameter enables the kernel to write dmesg
# upon a normal shutdown (shutdown, reboot, halt).
#
# To configure the kernel parameters, uncomment the appropriate
# line(s) below. The value written is either 'Y' to enable the
# kernel parameter, or 'N' to disable the kernel parameter.
#
# After making a change to this file, do:
# systemd-tmpfiles --create path/to/tmpfiles.d/systemd-pstore.conf
#
# These changes are automatically applied on future re-boots.
d /var/lib/systemd/pstore 0755 root root 14d
#w- /sys/module/printk/parameters/always_kmsg_dump - - - - Y
#w- /sys/module/kernel/parameters/crash_kexec_post_notifiers - - - - Y