From 2525682565b372b9b83c848bfe89c025fed47a1d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 5 Aug 2021 13:22:58 +0200 Subject: [PATCH] units: make sure systemd-tmpfiles-{setup,clean} don't survive switch-root Normally, these services are killed because we run isolate. But I booted into emergency mode (because of a futher bug with us timing out improperly on the luks password prompt), and then continuted to the host system by running 'systemctl start systemd-switch-root.service'. My error, but the results are confusing and bad: systemd in the host sees 'systemd-tmpfiles-setup.service' as started successfully, and doesn't restart it, so the setup for /tmp/.X11 is not done and gdm.service fails. So while we wouldn't encounter this during normal successful boot, I think it's good to make this more robust. The dep is added to systemd-tmpfiles-{setup,clean}, because /tmp is not propagated over switch-root. /dev is, so I didn't touch systemd-tmpfiles-setup-dev.service. --- units/systemd-tmpfiles-clean.service | 2 +- units/systemd-tmpfiles-setup.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/units/systemd-tmpfiles-clean.service b/units/systemd-tmpfiles-clean.service index e962954f06c..7aee6463bd5 100644 --- a/units/systemd-tmpfiles-clean.service +++ b/units/systemd-tmpfiles-clean.service @@ -11,7 +11,7 @@ Description=Cleanup of Temporary Directories Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) DefaultDependencies=no -Conflicts=shutdown.target +Conflicts=shutdown.target initrd-switch-root.service After=local-fs.target time-set.target Before=shutdown.target diff --git a/units/systemd-tmpfiles-setup.service b/units/systemd-tmpfiles-setup.service index 3f028d25337..bc29dbc8c9c 100644 --- a/units/systemd-tmpfiles-setup.service +++ b/units/systemd-tmpfiles-setup.service @@ -11,7 +11,7 @@ Description=Create Volatile Files and Directories Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) DefaultDependencies=no -Conflicts=shutdown.target +Conflicts=shutdown.target initrd-switch-root.service After=local-fs.target systemd-sysusers.service systemd-journald.service Before=sysinit.target shutdown.target RefuseManualStop=yes -- 2.39.2