From 3bbbd62cbcfca6ba5c907dc6c350ff319037bad9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Jan 2013 13:46:34 +0100 Subject: [PATCH] Start dhcpcd/wpa_supplicant after systemd-udev-settle This is necessary to prevent a race. Udev 197 has a new naming scheme for network devices, so it will rename (say) eth0 to eno0. This fails with "error changing net interface name eth0 to eno1: Device or resource busy" if another process has opened the interface in the meantime. --- modules/services/networking/dhcpcd.nix | 1 + modules/services/networking/wpa_supplicant.nix | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/services/networking/dhcpcd.nix b/modules/services/networking/dhcpcd.nix index cf7f621a85d..739ba95d5e3 100644 --- a/modules/services/networking/dhcpcd.nix +++ b/modules/services/networking/dhcpcd.nix @@ -96,6 +96,7 @@ in { description = "DHCP Client"; wantedBy = [ "network.target" ]; + after = [ "systemd-udev-settle.service" ]; # Stopping dhcpcd during a reconfiguration is undesirable # because it brings down the network interfaces configured by diff --git a/modules/services/networking/wpa_supplicant.nix b/modules/services/networking/wpa_supplicant.nix index b338e08113e..4f8ae55d209 100644 --- a/modules/services/networking/wpa_supplicant.nix +++ b/modules/services/networking/wpa_supplicant.nix @@ -90,8 +90,10 @@ in services.dbus.packages = [ pkgs.wpa_supplicant ]; jobs.wpa_supplicant = - { startOn = "started network-interfaces"; - stopOn = "stopping network-interfaces"; + { description = "WPA Supplicant"; + + wantedBy = [ "network.target" ]; + after = [ "systemd-udev-settle.service" ]; path = [ pkgs.wpa_supplicant ];