1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00

Merge pull request #35141 from abbradar/dhcpcd-order

dhcpcd service: fix service dependencies when default gateways are set
This commit is contained in:
Franz Pletz 2018-02-20 16:07:49 +00:00 committed by GitHub
commit 17952ee589
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -156,11 +156,11 @@ in
systemd.services.dhcpcd = let
cfgN = config.networking;
hasDefaultGatewaySet = (cfgN.defaultGateway != null && cfgN.defaultGateway.address != "")
|| (cfgN.defaultGateway6 != null && cfgN.defaultGateway6.address != "");
&& (!cfgN.enableIPv6 || (cfgN.defaultGateway6 != null && cfgN.defaultGateway6.address != ""));
in
{ description = "DHCP Client";
wantedBy = optional (!hasDefaultGatewaySet) "network-online.target";
wantedBy = [ "multi-user.target" ] ++ optional (!hasDefaultGatewaySet) "network-online.target";
after = [ "network.target" ];
wants = [ "network.target" ];

View file

@ -74,7 +74,7 @@ let
else optional (dev != null && dev != "lo" && !config.boot.isContainer) (subsystemDevice dev);
hasDefaultGatewaySet = (cfg.defaultGateway != null && cfg.defaultGateway.address != "")
|| (cfg.defaultGateway6 != null && cfg.defaultGateway6.address != "");
|| (cfg.enableIPv6 && cfg.defaultGateway6 != null && cfg.defaultGateway6.address != "");
networkLocalCommands = {
after = [ "network-setup.service" ];