First, the init system starts the /etc/init.d/net.wlan0 initscript. Next, this init script fires up wpa_supplicant and wpa_cli, telling the latter to send status reports to /etc/wpa_supplicant/wpa_cli.sh. Next, a network is associated. A while later, the association breaks for some reason (wireless is flaky, it happens). Now, wpa_cli invokes /etc/wpa_supplicant/wpa_cli.sh with the action field ($2) set to DISCONNECT. This switches on $ACTION and ends up deciding to run /etc/init.d/net.wlan0 stop in the background. This kills wpa_supplicant, meaning the network association can never be re-established. Changing the line: EXEC="${EXEC} stop" in wpa_cli.sh to: EXEC="false ${EXEC} stop" "fixes" the problem (it leaves wpa_supplicant running, allowing it to reconnect to the network—or, indeed, connect to another network), but this probably plays havoc with switching between networks and the fancy per-SSID configuration that's possible through /etc/conf.d/net (I haven't checked). Reproducible: Always
Hmm, I'm can see the problem, but I must admit, that I cannot see all the implications that would result from changing that in wpa_cli.sh :) I really cannot figure out why the file was installed in the first place (it was there when I took over wpa_supplicant). I doesn't make much sense, since you are right about loosing network will stop the network all together. Also, the part with CONNECTED/start doesn't make much sense, since it's only supposed to run AFTER net.wlanX has been started already. Could you try and run with your fix for a few days, and see if anything breaks from it, and then report back? If it doesn't break, I'm tempted to just change it and -r4 wpa_supplicant :)
I'll be happy to test, but I don't roam from SSID to SSID. I had assumed that wpa_cli.sh was somehow responsible for doing things like running dhcpcd or similar after the network associates, or doing the fancy stuff in /etc/conf.d/net where you can specify a static IP and route configuration per-SSID. I don't know how, exactly, though. I'm away from home right now, but when I return I can test a static IP/route.
I have commented it out in 0.7.3-r4, lets see if that works for people :) At least we know, that how it does it now breaks it horrible.
This change completely broke my wireless connection. Also I've never run into the issue Christopher describes. If the wireless connection ever drops then as soon as it is back wpa_supplicant reconnects fine and does not kill itself. My /etc/conf.d/net contains: config_wlan0="192.168.1.3/24" routes_wlan0="default via 192.168.1.1" wpa_supplicant_wlan0="-Dnl80211" and /etc/wpa_supplicant/wpa_supplicant.conf contains: network={ ssid="ssid" proto=RSN key_mgmt=WPA-PSK group=CCMP pairwise=CCMP psk="psk" }
Hmm, try -r5 and see if that works. I have changed the script, so only the stop part is deactivated - lets see if that makes a difference.
(In reply to comment #5) > Hmm, try -r5 and see if that works. > I have changed the script, so only the stop part is deactivated - lets see if > that makes a difference. yes, issue solved (https://forums.gentoo.org/viewtopic-t-885752-highlight-.html and bug #374419)d
I wonder if this may also have some different effects depending on whether one is using wpa_supplicant alone (like me) or in combination with some other tool, if that's possible (iwconfig? NetworkManager?).
Thats quite possible - I must admit, I cannot keep up with every combination of things that can be used together with wpa_supplicant (people keeps coming up with combinations) :-)