2020-11-09 07:23:58 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
pstore: introduce tmpfiles.d/systemd-pstore.conf
The systemd pstore service archives the contents of /sys/fs/pstore
upon boot so that there is room for a subsequent dump. The issue is
that while the service is present, 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, and
printk.always_kmsg_dump parameter enables the kernel to write dmesg
upon a shutdown (shutdown, reboot, halt).
As it stands today, these parameters are not managed/manipulated by
the systemd pstore service, and are solely reliant upon the user [to
have the foresight] to set them on the kernel command line at boot, or
post boot via sysfs. Furthermore, the user would need to set these
parameters in a persistent fashion so that that they are enabled on
subsequent reboots.
This patch introduces the setting of these two kernel parameters via
the systemd tmpfiles technique.
2020-04-14 00:22:04 +03:00
#
# 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
2020-08-04 12:30:51 +03:00
# 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
pstore: introduce tmpfiles.d/systemd-pstore.conf
The systemd pstore service archives the contents of /sys/fs/pstore
upon boot so that there is room for a subsequent dump. The issue is
that while the service is present, 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, and
printk.always_kmsg_dump parameter enables the kernel to write dmesg
upon a shutdown (shutdown, reboot, halt).
As it stands today, these parameters are not managed/manipulated by
the systemd pstore service, and are solely reliant upon the user [to
have the foresight] to set them on the kernel command line at boot, or
post boot via sysfs. Furthermore, the user would need to set these
parameters in a persistent fashion so that that they are enabled on
subsequent reboots.
This patch introduces the setting of these two kernel parameters via
the systemd tmpfiles technique.
2020-04-14 00:22:04 +03:00
# 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
2020-05-25 17:11:51 +03:00
#w- /sys/module/printk/parameters/always_kmsg_dump - - - - Y
2020-08-04 12:30:51 +03:00
#w- /sys/module/kernel/parameters/crash_kexec_post_notifiers - - - - Y