mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
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:
parent
11cf80ae32
commit
52e2e7027d
@ -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 = ''
|
||||
|
@ -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 ];
|
||||
|
Loading…
Reference in New Issue
Block a user