Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90443 - Network won't start automatically in low signal strength conditions
Summary: Network won't start automatically in low signal strength conditions
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-25 15:36 UTC by Mark Knecht
Modified: 2005-10-20 02:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Knecht 2005-04-25 15:36:43 UTC
I have one wireless machine that sits in a low signal strength position in our home. The machine had been running FC2 and ndiswrapper. With FC2 if the network didn't come up at boot time then the FC2 scripts would continue trying to attach to the network and within a few minutes the machine would have connectivity. Once connected the machine would stay connected fine, but if it dropped off the network would reattach itself soon afterward.

We have recently (1 week ago) converted the machine to Gentoo. The machien works well except for the boot time /etc/init.d/net.wlan0 script. Apparently this script tries only once to connect. If it attaches, then fine, but if not it doesn't try again. The machine boots and then no user can get access to the network. As a byproduct of not attaching the init scripts never bring up sshd, samba, mythbackend and possibly one or two other things.

Running the script requires root access and enough training to know what scripts to run. 

Can the scripts be improved to make the machine continue to try to attach so that over time a user would see the machine working correctly?

Additionally, can the scripts that depend on network access be improved so that once the wireless network attaches I do not have to go to the machine personally to get sshd running?

Reproducible: Always
Steps to Reproduce:
1. Boot with router turned off
2. Turn on router 
3. connection never happens

Actual Results:  
The machien stays disconnected forever.

Expected Results:  
I would like it to attach when the router is back up or signal strength is better.

dragonfly ~ # emerge info
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 i686)
=================================================================
System uname: 2.6.11-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.6.11
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Apr 16 2005, 03:24:16)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 audiofile avi berkdb bitmap-fonts caps cdr crypt cups
curl dvd dvdr dvdread emboss encode esd fam firebird flac fluidsynth foomaticdb
fortran gd gdbm gif gimp gimpprint gnome gpm gstreamer gtk gtk2 i8x0 imlib ipv6
jack jack-tmpfs java jpeg kde ladcca ladspa libg++ libwww lirc mad mikmod mjpeg
mmx motif mozcalendar mozilla mp3 mpeg mysql mythtv ncurses nls nptl nptlonly
ogg oggvorbis opengl oss pam pdflib perl png ppds python qt quicktime readline
samba sdl sndfile spell sse sse2 ssl svga tcltk tcpd threads tiff transcode
truetype truetype-fonts type1-fonts usb v4l v4l2 vorbis xml2 xmms xscreensaver
xv xvid zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

dragonfly ~ #
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-04-25 15:43:19 UTC
Does sys-apps/ifplugd work with WiFi? It should, according to the documentation...
Comment 2 Mark Knecht 2005-04-25 15:55:59 UTC
I had a quick look at the home page. As for the wireless part it seems like it might help. I am not sure how it addresses something like sshd not being started at boot time and needing to be started after the wireless link is established.

This will take a few days to look at in more detail.

The mailing list for this app is very low volume. I'll sign up and ask some questions there if it looks encouraging.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-04-25 16:17:16 UTC
sshd should start even without your wireless link if you set RC_NET_STRICT_CHECKING="no" (needs ~arch baselayout to work correctly, IIRC). 
Comment 4 Mark Knecht 2005-04-25 16:52:31 UTC
Sorry for my newbieness. In what conf file to I find RC_NET_STRICT_CHECKING?

I think I have the ~x86 version of baselayout:

dragonfly ~ # ACCEPT_KEYWORDS="~x86" emerge -pv baselayout

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-apps/baselayout-1.11.11-r1  -bootstrap -build -debug -static (-uclibc) 0 kB

Total size of downloads: 0 kB
dragonfly ~ #
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-04-25 16:55:15 UTC
/etc/conf.d/rc
Comment 6 Mark Knecht 2005-04-25 16:57:35 UTC
Already set that way:


RC_NET_STRICT_CHECKING="no"

Comment 7 Mark Knecht 2005-04-25 16:59:58 UTC
Possibly you meant

RC_NET_STRICT_CHECKING="none"?

# RC_NET_STRICT_CHECKING allows some flexibility with the 'net' service.
# The following values are allowed:
#  none  - The 'net' service is always considered up.
#  no    - This basically means that at least one net.* service besides net.lo
#          must be up.  This can be used by notebook users that have a wifi and
#          a static nic, and only wants one up at any given time to have the
#          'net' service seen as up.

I do not enable the wired interface because I don't use it. Could I enable net.eth0 but somehow get the routes set up correctly even if wlan0 isn't up yet?
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2005-04-25 17:11:39 UTC
>Possibly you meant
>RC_NET_STRICT_CHECKING="none"?

Sure, sorry... 
Comment 9 Mark Knecht 2005-04-25 17:33:12 UTC
OK - I'll try that on next reboot.
Comment 10 Henrik Brix Andersen 2005-04-26 12:07:37 UTC
Don't know why this got assigned to mobile@...
Comment 11 SpanKY gentoo-dev 2005-04-26 16:33:01 UTC
is your /etc/init.d/net.wlan0 a sep file or is it a symlink to /etc/init.d/net.lo ?
Comment 12 Mark Knecht 2005-04-26 16:47:01 UTC
Actually I was surprised to see that it is neither:

dragonfly init.d # ls -la net*
lrwxrwxrwx  1 root root     6 Apr 21 16:43 net.eth0 -> net.lo
-rwxr-xr-x  1 root root 24246 Apr 21 16:43 net.lo
lrwxrwxrwx  1 root root    20 Apr 18 07:38 net.wlan0 -> /etc/init.d/net.eth0
-rwxr-xr-x  1 root root  2873 Apr 21 16:43 netmount
dragonfly init.d #

What woyuld the suggested setup be for a systme that will boot to wireless and is not enabling net.eth0 at all?

The issue here was that the 2005.0 universal install didn't do anything about net.wlan0 so I asked some questions on the user list and this was the suggestion.

Thanks!
Comment 13 SpanKY gentoo-dev 2005-04-26 17:08:25 UTC
what you've shown is fine ... as long as net.wlan0 *eventually* resolves to net.lo in baselayout-1.11.x, you're ok wrt that :)
Comment 14 Mark Knecht 2005-04-26 18:22:39 UTC
OK, I've found a small downtime in MythTV usage, change RC_NET_STRICT_CHECKING="none" and done a reboot.

1) Indeed net.wlan0 did not start at boot time, as usual.
2) A few things that weren't starting before are starting now
- sshd
- nfs
3) I gave the machine a few minutes to let net.wlan0 come up on it's own. It did not.
4) As root I issued /etc/init.d/net.wlan0 start about 5-6 times. net.wlan0 finally started.
5) I tried ssh -l mark dragonfly and was able to connect so it appears that once net.wlan0 was up that sshd was working correctly.

That's where I am not. I have connectivity which is great, but it doesn't appear that this change in strict checking has done anything to allow net.wlan0 to come up after boot time. This still appears to require that I log in as root and start net.wlan0 by hand.

Worse, I ran into another issue. The reasonto convert this machine from FC2 to Gentoo was to bring it up as a MythTV backend which I didn't want to do under FC2. Much happier on Gentoo doing that stuff. However either MythTV, MySQL or both are requiring network for them to be started at boot time and since wlan0 wasn't up they didn't start, so it appears the strict checking option is only allowing other netoworking apps/daemons to start and isn't allowing mysql/mythbackend to start.

This would be a total hack but could I start net.eth0 on some bogus address but still automatically set the routing tables to be wlan0 if and when it eventually comes up? That won't fix me having to start wlan0 by hand but at least it would allow MythTV to start up correctly when the machine is booted.

And the real question is what's needed to get the scripts to attempt to bring up wlan0 later? Should it be a cron job? There's some package I was looking at called sys-process/daemontools that has some sort of process monitoring capabilities and can supposedly be configured to reastart daemons when they die or don't start. I tried but my newbieness seemed to have beaten me out.

Thanks
Comment 15 Antti Mäkelä 2005-06-12 08:50:40 UTC
You could try this:

In /etc/conf.d/wireless

set the option

sleep_associate_eth0="600"

Which gives the interface up to 10 minutes to try to find a connection.

For some reason, there is no "infinity" option which would allow it to keep
trying forever.
Comment 16 Roy Marples (RETIRED) gentoo-dev 2005-08-02 03:00:44 UTC
associate_timeout_eth1=0

Now enables an infinite timeout for wpa_supplicant and iwconfig. The old
variables (wpa_timeout_eth1 and sleep_associate_eth1 are still supported).

That is now in our svn repo and will be in baselayout-1.12.0_pre4

As to the restarting issue, ifplugd may work with your wireless.
wpa_supplicant - if it supports your hardware - will do exactly what you need
when you use wpa_supplicant-0.4.x and baselayout-1.12.0_pre3-r2 or better.
Comment 17 Roy Marples (RETIRED) gentoo-dev 2005-10-20 02:57:15 UTC
pre9 is out, and should fix the issue. Re-open if you disagree