Wireless networking: /etc/rc.d/network start fails on first run, works on second
ArchThis Forum is for the discussion of Arch Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Wireless networking: /etc/rc.d/network start fails on first run, works on second
My wireless network is failing to come up at boot, but when I run /etc/rc.d/network restart it comes up fine. As I understand it that's the exact same script run at boot, so it seems a little odd.
The problem arose after I installed a bunch of backlogged updates.
My network uses WEP encryption. (Yes, I know it's insecure, but my Nintendo DS Lite doesn't support WPA, so I have no choice.)
After boot, iwconfig lists that the wireless network is not associated with any access point.
I've tried the 'standard network daemon' setup described here.
During boot, the failure message mentions increasing 'WIRELESS_TIMEOUT'. How is this done?
The relevant part of 'lspci -v' is
Code:
02:09.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
Subsystem: D-Link System Inc AirPlus G DWL-G510 Wireless Network Adapter (Rev.C)
Flags: bus master, slow devsel, latency 64, IRQ 17
Memory at f7ff0000 (32-bit, non-prefetchable) [size=32K]
Capabilities: <access denied>
Kernel driver in use: rt61pci
Kernel modules: rt61pci
'lsmod' gives the following; it seems all the relevant modules have been automatically loaded
#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_GB.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="Europe/London"
KEYMAP="uk"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(!usblp)
# Scan for LVM volume groups at startup, required if you use LVM
USELVM="yes"
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="bevelle"
# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
#
# DHCP: Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
#Static IP example
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
#wlan0="dhcp"
wlan_wlan0="wlan0 essid O2wirelessFCBEB6 key B5D758BBB7"
wlan0="dhcp"
INTERFACES=(wlan0)
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
# Enable these network profiles at boot-up. These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)
# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng network @sshd @openntpd netfs crond alsa hal @mpd fam @cups)
I have tried putting 'rt61pci' in the MODULES array. I have tried 'wlan0="dhcp"' and 'wlan_wlan0="...' both ways around. Neither of these worked.
This problem is leaving me frankly baffled. What's going wrong here?
Last edited by cantab; 01-19-2010 at 07:07 PM.
Reason: thread retitled
Do you have an ifstate file? If so can you check it after booting, and after running /etc/rc.d/network restart, I expect it will show:
lo=lo
wlan0=wlan0
when the wireless is functioning.
Also do you have an /etc/network/interfaces file? If so, can you paste settings therein. It may not exist on Arch, since I don't have a /etc/rc.conf file on my Debian Lenny - the only reason I ask is that I have:
/etc/network/ifstate and /etc/network/interfaces don't exist on Arch. Configuration is handled in /etc/rc.conf (my setup) or in /etc/conf.d/wireless (which has no uncommented lines on my system), or by various network managers (which are not necessary for a desktop computer)
Okay, first can you check that udev runs before your boot network(ing) starts since the archwiki says that this (udev) loads the module, rt61pci in your case if I'm not mistaken, that sets up the wlan0 interface.
Second, is there a reason that you have disabled gateway in ROUTES=(!gateway)?
Third, again from archwiki, it appears that /etc/rc.sysinit loads, amoung others, rc.conf, udev and MODULES in rc.conf, according to yours, MODULES=(!usblp), so I assume that rt61pci is loaded by the line MOD_AUTOLOAD="yes" - perhaps your dmesg.log shows the order the various pieces of your networking setup are invoked, but it looks to me that there is something wrong in your order, if, as you state it works fine on an /etc/rc.d/network restart
Udev does run before networking in the boot process.
I think gateway being disabled is the default. I'm pretty sure it's not needed since my network uses DHCP - and anyway that IP doesn't correspond to anything (it's not even on the same subnet as my computer and router use).
I found the following on the archwiki Wireless Setup, which may help:
Quote:
How it works
The Arch kernel is modular, meaning many of the drivers for machine hardware reside on the hard drive and are available as modules. At boot, udev takes an inventory of your hardware. Udev will load appropriate modules (drivers) for your corresponding hardware, and the driver, in turn, will allow creation of a kernel interface.
The interface name for different drivers and chipsets will vary. Some examples are wlan0, eth1, and ath0.
* Note: Udev is not perfect. If the proper module is not loaded by udev on boot, simply modprobe it and add the module name to etc/rc.conf on the MODULES= line.
I tried putting "WIRELESS_TIMEOUT=9001" in /etc/conf.d/wireless, and that just made the boot process hang! I had to use systemrescuecd to change it back.
I'm pretty sure the right modules ARE being loaded. In any case, when I put it in explicitly, it didn't fix the problem.
I tried moving network to the end of the list of daemons (despite that putting it after stuff that needs the network). No help.
EDIT:I disable network altogether during the boot process, then ran "/etc/rc.d/network start" manually. The first run failed. The second succeeded.
So it seems the first time it's run, it's sort of part way setting it up, then failing
Thread retitled to reflect the new characterisation.
I entered WIRELESS_TIMEOUT into http://www.google.com/linux and got a number of hits, which I suggest you investigate, rather than me trying to find something and then posting here.
Seems weird that the bug only appeared after updates...maybe because of a change in the wireless driver, since I'm pretty sure the init scripts weren't in the updates.
I've tried the hack solution of commenting out the check that fails in /etc/rc.d/network. Will see if it works next time I reboot.
Have you tried setting /etc/rc.conf gateway=(default gw xxx.yyy.zzz.1) to whatever IP address you have assigned to your router access point, you would then have to remove the '!' out of the ROUTES=(!gateway) line.
From your post #11 it appears that your wlan0 interface is not finding the MAC address of your router, if you have an /sbin/iwconfig file, then perhaps you could run a script that reads:
iwconfig wlan0 ap 00:19:7E:52:F9:F2 commit
obviously you will have to change the above MAC address to match that of your router, again if you have /sbin/iwconfig then said router MAC address will show up, once you are connected, if you run:
iwconfig wlan0
Needless to say, since iwconfig is in the 'sys'bin these commands must be executed as root, sudo, whatever.
I couldn't find any reference to a boot.log file on archwiki, if you don't have one, and you can find a way to create one, then we would have a better 'clue' of when and what is happening/hanging with your wireless connection.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.