Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A quest for sane and understandable wireless management
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
Simius
Apprentice
Apprentice


Joined: 26 Oct 2002
Posts: 219
Location: Budapest, Hungary

PostPosted: Wed Feb 14, 2007 2:13 pm    Post subject: A quest for sane and understandable wireless management Reply with quote

Hi!

I'm a bit fed up. :) My stationary computer connects to a stationary AP, so I thought setting wireless up in the Gentoo scripts would perfectly do the job. Well, it doesn't.

It's not necessarily the Gentoo scripts that are at fault - more likely it's the madwifi driver and wpa_supplicant that shouldn't stop working every 12 hours or so. (Yes, I agree many sad souls tormented by madwifi would find that an acceptable uptime.) However, what I can't bear is that when ath0 dies*, all my internet daemons die with it, and I need to start samba, tor, privoxy and ntpd all by hand. Sometimes when wireless "fixes itself", and restores connection without me doing the stop / start thingie, the daemons still die, and I don't even notice their absence.

I'm looking for a clean framework to handle wireless connections, to automagically shut down and bring up daemons dependent upon internet connectivity, and to save me from doing /etc/init.d/net.ath0 stop /etc/init.d/net.ath0 start /etc/init.d/net.ath0 stop /etc/init.d/net.ath0 start** every single day.

* This is what it looks like on syslog. It's solved** by /etc/init.d/net.ath0 stop and /etc/init.d/net.ath0 start.
Code:

23:18:18 CET [notice] wpa_cli: interface ath0 DISCONNECTED
23:18:19 CET [notice] wpa_cli: interface ath0 CONNECTED
23:18:23 CET [notice] wpa_cli: interface ath0 DISCONNECTED
23:18:24 CET [notice] wpa_cli: interface ath0 CONNECTED
23:18:33 CET [notice] wpa_cli: interface ath0 DISCONNECTED
23:18:36 CET [notice] wpa_cli: interface ath0 CONNECTED


** Well, mostly... erm... more like, sometimes solved. In the majority of cases it looks like this:
Code:

# /etc/init.d/net.ath0 stop
 * Stopping ath0
 * Bringing down ath0
 * Shutting down ath0 ...                                             [ ok ]
 * Stopping wpa_cli on ath0 ...                                       [ ok ]
 * Stopping wpa_supplicant on ath0 ...                                [ ok ]
# /etc/init.d/net.ath0 start
 * WARNING:  net.ath0 has already been started.
# /etc/init.d/net.ath0 stop
 #*#*# I'm not entirely sure about these messages, but the main thing is that ath0 "goes down" AGAIN #*#*#
 * Stopping ath0
 * Bringing down ath0
 * Shutting down ath0 ...                                             [ ok ]
# /etc/init.d/net.ath0 start
 * Starting ath0
 * Starting wpa_supplicant on ath0 ...                                  [ ok ]
 * Starting wpa_cli on ath0 ...                                         [ ok ]
 * Backgrounding ...

This I'm sure has nothing to do with madwifi bugs. This is the Gentoo scripts going ga-ga.
_________________
You kinda have to sneak up on a mac...
- PC vs MAC (http://www.youtube.com/watch?v=iEAGmBRC1dc)
Back to top
View user's profile Send private message
vandien
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2006
Posts: 137

PostPosted: Wed Feb 14, 2007 7:43 pm    Post subject: Reply with quote

try changing this, there's an explanation in the file.
/etc/conf.d/rc:
RC_NET_STRICT_CHECKING="lo"

it should at least mean that you don't have to worry about manually doing anything with services (samba, etc). I'm not sure how to help with the wireless connection dropping.. it may be inevitable that you have to restart wireless sometimes. I've been wanting to try "net-misc/networkmanager" for a while but haven't had time. it might be worth a look, but from what I've read there are still some issues.
Back to top
View user's profile Send private message
Simius
Apprentice
Apprentice


Joined: 26 Oct 2002
Posts: 219
Location: Budapest, Hungary

PostPosted: Sat Feb 17, 2007 12:59 pm    Post subject: Reply with quote

vandien wrote:
try changing this, there's an explanation in the file.
/etc/conf.d/rc:
RC_NET_STRICT_CHECKING="lo"


Alas, that's not a possibility. The services die on start if I do that, as they have no network interfaces to use. This is especially a problem with ntp-client, which in turn is mostly needed before ntpd is started.

vandien wrote:
it should at least mean that you don't have to worry about manually doing anything with services (samba, etc). I'm not sure how to help with the wireless connection dropping.. it may be inevitable that you have to restart wireless sometimes. I've been wanting to try "net-misc/networkmanager" for a while but haven't had time. it might be worth a look, but from what I've read there are still some issues.

I just looked into the net.X rc scripts, and they are complicated beyond belief.

This is something that happens often:
Code:

11:50:23 CET [notice] wpa_cli: interface ath0 DISCONNECTED
11:50:23 CET [notice] wpa_cli: interface ath0 CONNECTED
11:50:34 CET [warning] rc-scripts: Configuration not set for ath0 - assuming DHCP
11:50:34 CET [err] rc-scripts: No DHCP client installed
11:50:34 CET [notice] wpa_cli: executing '/etc/init.d/net.ath0 --quiet start' failed
11:50:34 CET [notice] wpa_cli: interface ath0 DISCONNECTED
11:50:34 CET [notice] wpa_cli: interface ath0 CONNECTED
11:50:45 CET [warning] rc-scripts: Configuration not set for ath0 - assuming DHCP
11:50:45 CET [err] rc-scripts: No DHCP client installed
11:50:45 CET [notice] wpa_cli: executing '/etc/init.d/net.ath0 --quiet start' failed
11:50:45 CET [notice] wpa_cli: interface ath0 DISCONNECTED


I have ath0 configured under /etc/conf.d/wireless, and there of course is no config_ath0 - there IS an essid_ath0, and a config_<essid>, which seem to satisfy the rc scripts when starting the network up. However, it seems, when wpa_cli tries to reconnect after a disconnect, something goes awfully wrong, and the system looks for config_ath0.

Another nicety is when the same DISCONNECT - CONNECT - DISCONNECT happens with no error messages:
Code:

11:50:45 CET [notice] wpa_cli: interface ath0 DISCONNECTED
11:50:46 CET [notice] wpa_cli: interface ath0 CONNECTED
11:50:51 CET [notice] wpa_cli: interface ath0 DISCONNECTED
11:50:52 CET [notice] wpa_cli: interface ath0 CONNECTED
11:50:56 CET [notice] wpa_cli: interface ath0 DISCONNECTED
11:50:56 CET [notice] wpa_cli: interface ath0 CONNECTED
11:51:00 CET [notice] wpa_cli: interface ath0 DISCONNECTED


As I mentioned, it is fixed if I kill the net.ath0 service, and start it again. It would be nice to know WHAT gets restarted thus, and what ISN'T restarted when wpa_cli restarts the service?

This whole wireless management in the rc scripts looks awfully off to me. There's no telling what is running and what doesn't, and what started what. As I mentioned earlier, I need to stop the net.ath0 service twice. It might have something to do with wpa_cli (started by the net.ath0 service) actually managing the net.ath0 service.
It's not so hard to make such a mess of a setup go to hell.
_________________
You kinda have to sneak up on a mac...
- PC vs MAC (http://www.youtube.com/watch?v=iEAGmBRC1dc)
Back to top
View user's profile Send private message
deno
Guru
Guru


Joined: 13 Sep 2006
Posts: 411

PostPosted: Thu Jan 17, 2008 9:59 pm    Post subject: Reply with quote

Regarding wireless connection and wpa_cli. Maybe it could be because of a madwifi driver? I have a similar problem where I get a "ath0 disconnected" message from wpa_cli and then it reconects. It always happens after ntpd synchronization, but only with recent madwifi from svn. If I use <2.6.24 and older drivers that doesn't happen.
Back to top
View user's profile Send private message
deno
Guru
Guru


Joined: 13 Sep 2006
Posts: 411

PostPosted: Thu Jan 17, 2008 10:09 pm    Post subject: Reply with quote

It has nothing to do with ntpd daemon. Have just stoped it, and it still happens.
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