Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Integrating wpa_supplicant with Gentoo initscripts?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 533
Location: Cardiff, UK

PostPosted: Mon Jan 05, 2009 8:57 pm    Post subject: Integrating wpa_supplicant with Gentoo initscripts? Reply with quote

Hi there. Due to a recent kernel upgrade, the driver for my wireless card (rt2500) has moved in-tree, and in doing so has apparently dropped builtin support for WPA. I used to run /etc/init.d/net.ra0 start, and the interface was fully up and usable by the time the command exited. I now have /etc/init.d/net.wlan0 start, which exits with the noncommittal "net.wlan0 has started but is inactive." Presumably, this is because the initscript now hands-off the configuration process to wpa_supplicant and then washes its hands of the whole matter.

I'm looking for a way to get back the old functionality, where the initscript gives you a definite answer "has started" - rather than a lame excuse "might be ready at some point in the future". Is this actually possible, without resorting to WEP?

Cheers :)
_________________
Ryzen 5600x; Asus TUF Gaming B550-Plus; Geforce 1660 Super
Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
avieth
Veteran
Veteran


Joined: 17 Sep 2004
Posts: 1945
Location: Canada

PostPosted: Mon Jan 05, 2009 9:19 pm    Post subject: Reply with quote

Can the gentoo wireless guide help you? I use NetworkManager myself, but I looked at the wpa_supplicant section and it seems that all you have to do is tell the net script to use wpa_supplicant via /etc/init.d/conf.d/net, and then configure wpa_supplicant accordingly.

Ed.: Yes, yes I did misunderstand your question :oops:


Last edited by avieth on Tue Jan 06, 2009 9:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 533
Location: Cardiff, UK

PostPosted: Mon Jan 05, 2009 9:59 pm    Post subject: Reply with quote

Thanks for your reply, but I think you misunderstand my problem. I have no issues connecting to my network: everything works fine. I just don't like the way the initscript divests itself of all responsibility as soon as it invokes wpa_supplicant. I want it to either monitor wpa_supplicant and report back on the results of connecting, or even beter perform all the connection commands itself like it did when WPA was built-in to the driver.

I get the feeling this is going to be one of those "go-code-it-yourself" questions, though...
_________________
Ryzen 5600x; Asus TUF Gaming B550-Plus; Geforce 1660 Super
Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
RoundsToZero
Guru
Guru


Joined: 17 Nov 2003
Posts: 478
Location: New York, NY

PostPosted: Wed Jan 07, 2009 9:27 pm    Post subject: Reply with quote

You can use wpa_cli or wpa_gui to monitor the status of wpa_supplicant once it's been started. In fact I think this is what the init scripts do to tell you what's up when you run /etc/init.d/net.wlan0 status for example (i.e. it will change from "inactive" to "started" once it's actually started).

I think there may be some option for this so that you wouldn't have to make something that waits on wpa_cli yourself but I'm not near my Gentoo machine so I can't check. I'm pretty sure that for wired networks if you disable link monitoring it has the effect of waiting for dhcpcd to finish (or whatever you have configured to run when you bring the interface up) when you run the init script. Look in /etc/conf.d/net.example for stuff related to netplug or ifplugd and see if it says anything about wireless.
Back to top
View user's profile Send private message
agent_jdh
Veteran
Veteran


Joined: 08 Aug 2002
Posts: 1783
Location: Scotland

PostPosted: Sat Mar 14, 2009 2:47 am    Post subject: Reply with quote

I've done exactly the same - transitioned from the ralink-rt61 (ra0) driver to the in-kernel + wpa_supplicant (wlan0) method. Like yourself, I've successfully configured it fine, and also like yourself, I'd like to stop it "backgrounding" to wpa_supplicant to connect. Or at least wait until it is connected before proceeding.

Reason for this is that ntp-client fires up shortly after and cannot connect as net.wlan0 hasn't finished connecting to my router.

Oh, and a propos of nowt, the hardened server I'm running this on has just been upgraded to hardened-sources-2.6.28, and I get a kernel panic when net.wlan0 connects. I'm having to use my failsafe last-working kernel to get it to work.
_________________
Jingle Jangle Jewellery
Back to top
View user's profile Send private message
agent_jdh
Veteran
Veteran


Joined: 08 Aug 2002
Posts: 1783
Location: Scotland

PostPosted: Wed Mar 18, 2009 12:28 am    Post subject: Reply with quote

@RoundsToZero (and anyone else, frankly).

I got around to actually reading your post, and had a look at /etc/conf.d/net.example. The required option is -

associate_timeout

So for me using wlan0, adding the following line into the wlan section of /etc/conf.d/net fixes everything so it waits for wpa_supplicant -

associate_timeout_wlan0=30

30 seconds seems to be enough here.

YAY!!!!
_________________
Jingle Jangle Jewellery
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum