summaryrefslogtreecommitdiff
path: root/units
diff options
context:
space:
mode:
authorAlexander Graf <graf@amazon.com>2022-06-09 16:20:43 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-06-14 10:17:20 +0900
commit70e74a5997ae2ce7ba72a74ac949c3b2dad1a1d6 (patch)
tree7c724a4fb81db439515024e2b2632254031bcce7 /units
parent5d049ff9204b9aad48c62c296def4daa4b53005e (diff)
downloadsystemd-70e74a5997ae2ce7ba72a74ac949c3b2dad1a1d6.tar.gz
pstore: Run after modules are loaded
The systemd-pstore service takes pstore files on boot and transfers them to disk. It only does it once on boot and only if it finds any. The typical location of the pstore on modern systems is the UEFI variable store. Most distributions ship with CONFIG_EFI_VARS_PSTORE=m. That means, the UEFI variable store is only available on boot after the respective module is loaded. In most situations, the pstore service gets loaded before the UEFI pstore, so we don't get to transfer logs. Instead, they accumulate, filling up the pstore over time, potentially breaking the UEFI variable store. Let's add a service dependency on any kernel module that can provide a pstore to ensure we only scan for pstate after we can actually see pstate. I have seen live occurences of systems breaking because we did not erase the pstates and ran out of UEFI nvram space. Fixes https://github.com/systemd/systemd/issues/18540
Diffstat (limited to 'units')
-rw-r--r--units/systemd-pstore.service.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/units/systemd-pstore.service.in b/units/systemd-pstore.service.in
index 848e311e96..86de30ad4a 100644
--- a/units/systemd-pstore.service.in
+++ b/units/systemd-pstore.service.in
@@ -15,6 +15,8 @@ ConditionVirtualization=!container
DefaultDependencies=no
Conflicts=shutdown.target
Before=sysinit.target shutdown.target
+After=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
+Wants=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
[Service]
Type=oneshot