Skip to content
Snippets Groups Projects
Commit 514b7369 authored by Detlev Casanova's avatar Detlev Casanova
Browse files

Fix issue with journald and /var at shutdown

https://phabricator.apertis.org/T7904



Signed-off-by: default avatarDetlev Casanova <detlev.casanova@collabora.com>
parent 1f70b58b
No related branches found
No related tags found
No related merge requests found
systemd (247.3-6+apertis3) apertis; urgency=medium
* systemd-journal-flush: Add a requirement on var.mount
-- Detlev Casanova <detlevi.casanova@collabora.com> Wed, 26 Jan 2022 15:53:23 -0500
systemd (247.3-6+apertis2) apertis; urgency=medium
* d/p/basic-linux-Sync-if_arp.h-with-Linux-5.14.patch:
......
From: Detlev Casanova <detlev.casanova@collabora.com>
Date: Wed, 26 Jan 2022 15:30:42 -0500
Subject: systemd-journal-flush: Add a requirement on var.mount.
On some systems (like ostree), /var is already mounted (bind) when systemd
starts and is not in /etc/fstab, so there is no var.mount file (fragment)
generated by systemd-fstab-generator
var.mount unit still exists: it instantiated via /proc/self/mountinfo
RequiresMountsFor= does not add Requires= dependencies for .mount units if
there is no corresponding fragment file (it still adds them After=, though -
see unit_add_mount_dependencies() in unit.c)
=> systemd-journal-flush.service will have After=var.mount but no
Requires=var.mount.
=> On shutdown, nothing causes systemd-journal-flush.service to be stopped as
it does not require var.mount.
See https://github.com/systemd/systemd/issues/867#issuecomment-890768048
for details
This patch adds the Require= for var.mount. It fixes the unmounting of
/var at shutdown and doesn't influence systems that let systemd mount
/var.
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
units/systemd-journal-flush.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/units/systemd-journal-flush.service b/units/systemd-journal-flush.service
index 1a71592..e258866 100644
--- a/units/systemd-journal-flush.service
+++ b/units/systemd-journal-flush.service
@@ -11,7 +11,7 @@
Description=Flush Journal to Persistent Storage
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
DefaultDependencies=no
-Requires=systemd-journald.service
+Requires=systemd-journald.service var.mount
After=systemd-journald.service systemd-remount-fs.service
Before=systemd-tmpfiles-setup.service
RequiresMountsFor=/var/log/journal
......@@ -40,3 +40,4 @@ apertis/Remove-bashisms-from-the-entry-directory-plugin.patch
apertis/kernel-install-allow-to-create-BOOT-MACHINE_ID.patch
apertis/Fix-the-path-to-bootable-binaries-in-efi-entry.patch
apertis/basic-linux-Sync-if_arp.h-with-Linux-5.14.patch
apertis/systemd-journal-flush-Add-a-requirement-on-var.mount.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment