diff --git a/debian/changelog b/debian/changelog index a5034468b928c64065635655518dc3dccb024f0e..4f4ede08a947cf7ffb2f5750e34528df279c5951 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +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: diff --git a/debian/patches/apertis/systemd-journal-flush-Add-a-requirement-on-var.mount.patch b/debian/patches/apertis/systemd-journal-flush-Add-a-requirement-on-var.mount.patch new file mode 100644 index 0000000000000000000000000000000000000000..39c6012787c1ca2f71ce86c5e5f35a1ed0364a4c --- /dev/null +++ b/debian/patches/apertis/systemd-journal-flush-Add-a-requirement-on-var.mount.patch @@ -0,0 +1,43 @@ +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 diff --git a/debian/patches/series b/debian/patches/series index af5a7aa2ea42855f4071ae5b0364bf0bee07cd0e..6e1ed553804f56defc15b6663a71f869dea5af9e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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