From f89985ca494b79b2beed47e1f10d46ef2d59ce3e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 28 Nov 2023 08:32:22 +0900 Subject: [PATCH] unit: make journald stopped on soft-reboot before broadcasting SIGKILL Workaround for #30195. --- units/systemd-journald.service.in | 5 +++++ units/systemd-journald@.service.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in index 1c36ec8903c..37eeabc5103 100644 --- a/units/systemd-journald.service.in +++ b/units/systemd-journald.service.in @@ -15,6 +15,11 @@ Requires=systemd-journald.socket After=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket syslog.socket Before=sysinit.target +# To avoid journald SIGKILLed during soft-reboot and corrupting journals. +# See https://github.com/systemd/systemd/issues/30195 +Before=soft-reboot.target +Conflicts=soft-reboot.target + # Mount and swap units need the journal socket units. If they were removed by # an isolate request the mount and swap units would be removed too, hence let's # exclude systemd-journald and its sockets from isolate requests. diff --git a/units/systemd-journald@.service.in b/units/systemd-journald@.service.in index b705ce08ff5..c3bcb085335 100644 --- a/units/systemd-journald@.service.in +++ b/units/systemd-journald@.service.in @@ -13,6 +13,11 @@ Documentation=man:systemd-journald.service(8) man:journald.conf(5) Requires=systemd-journald@%i.socket systemd-journald-varlink@%i.socket After=systemd-journald@%i.socket systemd-journald-varlink@%i.socket +# To avoid journald SIGKILLed during soft-reboot and corrupting journals. +# See https://github.com/systemd/systemd/issues/30195 +Before=soft-reboot.target +Conflicts=soft-reboot.target + [Service] CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID CAP_MAC_OVERRIDE DevicePolicy=closed -- 2.47.3