Skip to content

Commit 9f52d1f

Browse files
committed
Revert "nixos/wireless: fix failure with no interfaces"
This reverts commit 8f17761. Attempting to start any service from udev when systemd-udev-settle is used at all hangs the boot for 2min. See issue #107341.
1 parent 4d0c6c6 commit 9f52d1f

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

nixos/modules/services/networking/wpa_supplicant.nix

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,9 @@ in {
233233
path = [ pkgs.wpa_supplicant ];
234234

235235
script = ''
236-
if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]; then
237-
echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
236+
if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]
237+
then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
238238
fi
239-
240239
iface_args="-s -u -D${cfg.driver} -c ${configFile}"
241240
${if ifaces == [] then ''
242241
for i in $(cd /sys/class/net && echo *); do
@@ -249,10 +248,6 @@ in {
249248
fi
250249
fi
251250
done
252-
if [ -z "$args" ]; then
253-
echo >&2 "<3>No wireless interfaces detected (yet)."
254-
exit 1
255-
fi
256251
'' else ''
257252
args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}"
258253
''}
@@ -266,7 +261,7 @@ in {
266261

267262
# Restart wpa_supplicant when a wlan device appears or disappears.
268263
services.udev.extraRules = ''
269-
ACTION=="add|remove", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", RUN+="/run/current-system/systemd/bin/systemctl restart wpa_supplicant.service"
264+
ACTION=="add|remove", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", RUN+="/run/current-system/systemd/bin/systemctl try-restart wpa_supplicant.service"
270265
'';
271266
};
272267

0 commit comments

Comments
 (0)