Merge pull request #35141 from abbradar/dhcpcd-order
dhcpcd service: fix service dependencies when default gateways are set
This commit is contained in:
commit
17952ee589
@ -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" ];
|
||||||
|
|
||||||
|
@ -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" ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user