From 48f7778d996fae8ab5e7177ac39ce9e86ed37b9b Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 5 Aug 2018 23:07:54 +0200 Subject: [PATCH] dhcpcd service: order before network target This reverts a change applied in PR #18491. When interfaces are configured by DHCP (typical in a cloud environment), ordering after network.target cause trouble to applications expecting some network to be present on boot (for example, cloud-init is quite brittle when network hasn't been configured for `cloud-init.service`) and on shutdown (for example, collectd needs to flush metrics on shutdown). When ordering after network.target, we ensure applications relying on network.target won't have any network reachability on boot and potentially on shutdown. Therefore, I think ordering before network.target is better. --- nixos/modules/services/networking/dhcpcd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix index de0aa1a2c2c3..019c8fd9ec48 100644 --- a/nixos/modules/services/networking/dhcpcd.nix +++ b/nixos/modules/services/networking/dhcpcd.nix @@ -161,8 +161,8 @@ in { description = "DHCP Client"; wantedBy = [ "multi-user.target" ] ++ optional (!hasDefaultGatewaySet) "network-online.target"; - after = [ "network.target" ]; wants = [ "network.target" ]; + before = [ "network.target" ]; # Stopping dhcpcd during a reconfiguration is undesirable # because it brings down the network interfaces configured by