KDE NetworkManager workaround
Wednesday November 7, 2007
In case anyone else hits this…. In one of the more recent releases of our beloved KDE, code was added to more smoothly integrate with networking. Namely, the attempt is now made to be aware of NetworkManager-initiated network connections, as well as know when NetworkManager doesn’t think it’s connected so as to not keep trying network activities when there might not be a network connection. Excellent idea, honestly.
However (you knew there was one), I have a love/hate relationship with NetworkManager and knetworkmanager. When they work, they work great. When they don’t it’s supremely irritating. Case in point: I’m at a friend’s house. He’s using standard WEP and a non-broadcasted ESSID. I tried all manners of asking NetworkManager nicely for a good 10 minutes to join the network to no avail. In the next 30 seconds, I manually iwconfig’d, ifconfig’d, and dhclient’d my way onto the network and things are working swimmingly. Almost. You see, with the changes we made (see paragraph #1), now KMail and Konqueror, etc., think that I don’t have a network connection because NetworkManager told them I don’t. However, I’ve discovered that I can coax KMail, Konqi, and friends to try using the network connection that I really do have (honestly!) but NetworkManager couldn’t provide for me by doing this on the CLI:
dcop kded networkstatus setNetworkStatus NMNetwork 0
It’s hack, but it seems to do the trick for the time being. I’ll hunt Will down later and ask him how to do this properly…
[UPDATE:] I caught Will and here’s the real skinny:
Either extend your manual connection script to register a fake network with kded that is online, or shoot the networkstatus system down by disabling it in kcmshell kcmkded. You can also unregister NMNetwork; the system should be fail-safe. Or not run knetworkmanager. The system figures the best connection status, so you can also register your own network. 0 is ‘no information’, 6 is offline, 8 is online in the status enums.
Will rocks, btw. =;)
I was having a similar problem with kppp. Whenever I tethered my laptop to my phone for a GPRS connection, konqui, etc… wouldn’t recognize it. I thought it was NetworkManager, but I had no idea how to fix it. Thank you!
Awesome!! Glad it helped somebody else!! =:)
Wouldn’t it be better to report bug in NetworkManager? It’s great software, you really should report bugs to make it even better.
Well, if you mean “report a bug in NetworkManager because it can’t connect to your friend’s network” then possibly, though I don’t honestly know if it’s a bug in NetworkManager or knetworkmanager or somewhere else entirely. And it’s one of those flakey things where sometimes it works just great and sometimes it doesn’t. And I don’t have the time to debug what layer of the stack is breaking (kernel module? ifup scripts? dhclient? networkmanager? dbus? knetworkmanager?) to be honestly sure that it’s NetworkManager’s fault.
I’ll assume that’s what you meant. And yah, you’re right, it would be good to report a bug to NetworkManager, but I don’t know what I’d report. “Sometimes it works and sometimes it doesn’t work.”? I don’t have a reproducible case to give anything useful to the devs to poke at.
Anyway, I agree with you that it’s a really good idea and great software… but just like other bits of the Linux Desktop, the underlying solidity of it relies on things that are many times out of the control of the devs.
I’ve already filled several bugs against NetworKManager because I really like the fnctionality which you have – once it works 😉
As a result most of the bugs I reported where fixed quite fast.
In case you have at least 5 min time: NetworkManager leaves quite a lot of information in /var/log/messages. Next time the network fails, copy the important bits of /var/log/messages and send them to a bug report (or to e and I fill the bug report). Also, you could quickly try to configure a static wpa_suplicant.conf file for your network and start wpa_supplicant with that in debug mode. In my case that unveiled the root of the problem and the developers were able to fix it. Maybe it’s wpa_supplicant which simply crashes because of some buffer overflow or something (in case of my problems it most often was the problem of wpa_supplicant, btw).
Anyway, NM 0.7 will come along with some major rework in the former quite shabby parts, so with a bit of luck things will work ich besser when NM 0.7 final is released (currently Fedora 8 ships with NM 0.7-pre-release and it is still very shabby).
Heya liquidat! =:) It’s good to hear about the work with NM 0.7! =:)
I’ve never been successful at using wpa_supplicant manually. I’ll have to try to do your suggestion, though. Very good idea. =:)
Thanks!! =:)
ahh, networkmanager.
I rely on it enough that I’d hate to turn it off (not a trivial thing to do anyways; I wrote myself a script to restart it back when it needed resetting often) but sometimes I do need to tell programs to ignore it because it’s crazy. it’d be nice if there was an option in networkmanager itself to do this, for the sake of people who are allergic to the terminal 😉