summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorVincent Bernat <vincent@bernat.ch>2018-08-05 23:07:54 +0200
committerVincent Bernat <vincent@bernat.ch>2018-08-05 23:07:54 +0200
commit48f7778d996fae8ab5e7177ac39ce9e86ed37b9b (patch)
tree25032356e548535ee7251c8ae7968d024a682638 /nixos/modules
parent8910795eee38963d97a637a159e209617c41905b (diff)
downloadnixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.tar
nixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.tar.gz
nixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.tar.bz2
nixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.tar.lz
nixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.tar.xz
nixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.tar.zst
nixlib-48f7778d996fae8ab5e7177ac39ce9e86ed37b9b.zip
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.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/networking/dhcpcd.nix2
1 files changed, 1 insertions, 1 deletions
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