dhcpcd: fix race between namespace setup and resolvconf

systemd requires paths in `ReadWritePaths=` to exist before setting up
the service sandbox, so dhcpcd should be ordered after resolvconf.
Making resolvconf a oneshot service ensure `After=resolvconf.service`
works correctly.
This commit is contained in:
rnhmjoj 2024-10-13 18:08:05 +02:00
parent 11cf80ae32
commit 52e2e7027d
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450
2 changed files with 3 additions and 1 deletions

View File

@ -145,6 +145,7 @@ in
wants = [ "network-pre.target" ];
wantedBy = [ "multi-user.target" ];
restartTriggers = [ config.environment.etc."resolvconf.conf".source ];
serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true;
script = ''

View File

@ -210,7 +210,8 @@ in
{ description = "DHCP Client";
wantedBy = [ "multi-user.target" ] ++ lib.optional (!hasDefaultGatewaySet) "network-online.target";
wants = [ "network.target" ];
wants = [ "network.target" "resolvconf.service" ];
after = [ "resolvconf.service" ];
before = [ "network-online.target" ];
restartTriggers = [ cfg.runHook ];