1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-22 22:03:43 +03:00

units: Shut down networkd and resolved on switch-root

Let's explicitly order these against initrd-switch-root.target, so
that they are properly shut down before we switch root. Otherwise,
there's a race condition where networkd might only shut down after
switching root and after we've already we've loaded the unit graph,
meaning it won't be restarted in the rootfs.

Fixes #27718

(cherry picked from commit 75efd16fb001ba19d12362198ba5c44cb6f40d04)
(cherry picked from commit 2e10f8874aeb1972322c3e0c8237cb8263bccd53)
This commit is contained in:
Daan De Meyer 2023-05-25 18:13:02 +02:00 committed by Luca Boccassi
parent 06b4e1fba1
commit bc3bad0056
2 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ ConditionCapability=CAP_NET_ADMIN
DefaultDependencies=no
# systemd-udevd.service can be dropped once tuntap is moved to netlink
After=systemd-networkd.socket systemd-udevd.service network-pre.target systemd-sysusers.service systemd-sysctl.service
Before=network.target multi-user.target shutdown.target
Conflicts=shutdown.target
Before=network.target multi-user.target shutdown.target initrd-switch-root.target
Conflicts=shutdown.target initrd-switch-root.target
Wants=systemd-networkd.socket network.target
[Service]

View File

@ -16,8 +16,8 @@ Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-resolver
DefaultDependencies=no
After=systemd-sysusers.service
Before=sysinit.target network.target nss-lookup.target shutdown.target
Conflicts=shutdown.target
Before=sysinit.target network.target nss-lookup.target shutdown.target initrd-switch-root.target
Conflicts=shutdown.target initrd-switch-root.target
Wants=nss-lookup.target
[Service]