Summary: | net-wireless/wpa_supplicant: wpa_cli: executing '/etc/init.d/net.wlan0 --quiet start' failed | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Phil <Phil> |
Component: | Current packages | Assignee: | Rick Farina (Zero_Chaos) <zerochaos> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | mail, mail, zerochaos |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/35579 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Call "restart" instead of just "start" on CONNECTED |
Description
Phil
2016-08-20 14:08:21 UTC
Created attachment 529064 [details, diff]
Call "restart" instead of just "start" on CONNECTED
Sorry for necro-posting, but since this bugreport is exactly what I am here for, i found it redundant to open a new bug for this.
The problem described by Phil is still present as of net-wireless/wpa_supplicant-2.6-r6. It can even be described more widely:
Suppose you have multiple lines in your /etc/conf.d/net:
config_homenet="192.168.0.21/24"
config_eduroam="dhcp"
If I am at home, I want a static IP. Now I suspend or hibernate my laptop and go to the university. There I resume my laptop. wpa_cli.sh calls "net.wlan0 start", but since this service is already started, it is basically a no-op. Since my previous configuration is still active, net.wlan0 now tries to set a static IP, while I am connected with eduroam. Most likely, this will fail. I will have to manually restart the service to get a working connection.
If however wpa_cli.sh would call "net.wlan0 restart" instead, the configuration file would be read in again and the service will start with the desired options.
Another example without suspending my laptop: Suppose "homenet" is my mobile access point I carry around. If I arrive at my university, I switch off the AP, while my laptop is still on and connected. wpa_supplicant will recognize the vanishing "homenet", do a quick scan, and will connect me with "eduroam". But again, the configuration will never be re-read since the service never stopped. I will get the same problem as described above. Like above, wpa_cli.sh should call "restart" here to account for the changed network.
The fix will be an additional two characters in wpa_cli.sh ("re") and I do not see any drawbacks that I am aware of.
The other point Phil mentioned, regarding the DISCONNECTED hook: I do not have it enabled and it works quite fine this way. I do not see a reason to re-enable it for this specific issue. But maybe someone with more insight on the decision to disable it in the first place can enlighten us.
+1 This bug causes per-SSID variables in /etc/conf.d/net to be ignored, as Florian noticed. However, I think that the correct way to fix this bug is to reenable the DISCONNECT event (maybe with "--nodeps" flag; this is the configuration I am currently using) - there is no reason for network configuration daemons, like dhcpcd, to be running if there is no network. Also, this was the state of affairs util bug 373921 came and commented this handler out. That bug is now solved in the proper way, since /lib/netifrc/net/wpa_supplicant.sh explicitly avoids stopping wpa_supplicant in its "post_stop" hook when called with IN_BACKGROUND env variable set (which /etc/wpa_supplicant/wpa_cli.sh sets). (In reply to Maciej S. Szmigiero from comment #2) > However, I think that the correct way to fix this bug is to reenable the > DISCONNECT event (maybe with "--nodeps" flag; this is the configuration I am > currently using) - there is no reason for network configuration daemons, like > dhcpcd, to be running if there is no network. BTW, both sys-apps/ifplugd and sys-apps/netplug Ethernet cable detection daemons call "start" / "stop" on their network interface init script upon the relevant cable in / out event, so there is no reason why the wireless equivalent of a network cable being connected or disconnected (AP association / disassociation) should do something different. The relevant scripts are here: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-apps/netplug/files/netplug-2 https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-apps/ifplugd/files/ifplugd.action |