Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/wireless: fix failure with no interfaces #104722

Merged
merged 1 commit into from Dec 15, 2020
Merged

Conversation

rnhmjoj
Copy link
Contributor

@rnhmjoj rnhmjoj commented Nov 23, 2020

Motivation for this change

This resolves issue #101963.

When the service is started and no interface is ready yet, wpa_supplicant
is being exec'd with no -i flags, thus failing. Once the interfaces
are ready, the udev rule would fire but wouldn't restart the unit because
it wasn't currently running (see systemctl(1) try-restart).

The solution is to exit (with a clear error message) but always restart
wpa_supplicant when the interfaces are modified.

Things done
  • Tested wpa_supplicant service is restarted
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This resolves issue NixOS#101963.

When the service is started and no interface is ready yet, wpa_supplicant
is being exec'd with no `-i` flags, thus failing. Once the interfaces
are ready, the udev rule would fire but wouldn't restart the unit because
it wasn't currently running (see systemctl(1) try-restart).

The solution is to exit (with a clear error message) but always restart
wpa_supplicant when the interfaces are modified.
@@ -261,7 +266,7 @@ in {

# Restart wpa_supplicant when a wlan device appears or disappears.
services.udev.extraRules = ''
ACTION=="add|remove", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", RUN+="/run/current-system/systemd/bin/systemctl try-restart wpa_supplicant.service"
ACTION=="add|remove", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", RUN+="/run/current-system/systemd/bin/systemctl restart wpa_supplicant.service"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Dec 15, 2020

Thank you. I'm merging this because the problem is starting to get annoying.

@rnhmjoj rnhmjoj merged commit 12f367b into NixOS:master Dec 15, 2020
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Dec 15, 2020

Backport to 20.09: 645b8a3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants