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

View File

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