From 29a8fbf49a0d16a25db8968f67a1f76f3d2021e9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 3 Feb 2022 12:15:00 +0100 Subject: [PATCH 1/2] units: move resolved to sysinit.target (from basic.target) 79a67f3ca4d32c37b5e754501852a85eae908a6a pulled systemd-resolved.service in from basic.target instead of multi-user.target, i.e. the idea is to make it an early boot service, instead of a regular service. However, early boot services are supposed to be in sysinit.target, not basic.target (the latter is just one that combines the early boot services in sysinit.target, the sockets in sockets.targt, the mounts in local-fs.target and so on into one big target). Also, the comit actually didn't add a synchronization point, i.e. not Before=, so that the whole thing was racy. Let's fix all that. Follow-up for 79a67f3ca4d32c37b5e754501852a85eae908a6a --- units/systemd-resolved.service.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/units/systemd-resolved.service.in b/units/systemd-resolved.service.in index 91e7c141e30..621fe34224d 100644 --- a/units/systemd-resolved.service.in +++ b/units/systemd-resolved.service.in @@ -16,7 +16,7 @@ Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-resolver DefaultDependencies=no After=systemd-sysusers.service -Before=network.target nss-lookup.target shutdown.target +Before=sysinit.target network.target nss-lookup.target shutdown.target Conflicts=shutdown.target Wants=nss-lookup.target @@ -54,5 +54,5 @@ User=systemd-resolve {{SERVICE_WATCHDOG}} [Install] -WantedBy=basic.target +WantedBy=sysinit.target Alias=dbus-org.freedesktop.resolve1.service From 047c2c14c55dd71d6a100c1a0d1f4677fc946205 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 22 Feb 2022 16:35:16 +0100 Subject: [PATCH 2/2] units: drop After=systemd-resolved.service from systemd-nspawn@.service resolved is now started as part of early boot hence we need no explicit ordering anymore. --- units/systemd-nspawn@.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/systemd-nspawn@.service.in b/units/systemd-nspawn@.service.in index d7bae83ac2e..e82575fb567 100644 --- a/units/systemd-nspawn@.service.in +++ b/units/systemd-nspawn@.service.in @@ -13,7 +13,7 @@ Documentation=man:systemd-nspawn(1) Wants=modprobe@tun.service modprobe@loop.service modprobe@dm-mod.service PartOf=machines.target Before=machines.target -After=network.target systemd-resolved.service modprobe@tun.service modprobe@loop.service modprobe@dm-mod.service +After=network.target modprobe@tun.service modprobe@loop.service modprobe@dm-mod.service RequiresMountsFor=/var/lib/machines/%i [Service]