Starting wlan0 during boot


11 posts
by haroldjclements » Sat Nov 03, 2012 5:51 pm
Hello forum,

I am fairly new to Arch Linux on the Raspberry Pi and I am having problems getting a wireless connection up before fstab is executed.

I can get it running after I have logged in (as root) by typing the following:
Code: Select all
# wpa_supplicant -B -Dwext -i wlan0 -c /ect/wpa_supplicant.conf   
# dchpcd
# mount -a


It appears that eth0 attempts (and fails) to start during boot and as there is no network fsbtab fails making the boot slow...

Any help with this will be gratefully received...
Harold Clements
Posts: 2
Joined: Sat Nov 03, 2012 3:37 pm
by Grauhut » Mon Nov 05, 2012 9:52 pm
I had a similar prob and installed old fashioned initscripts.
https://wiki.archlinux.org/index.php/Sy ... _emulation

pacman -S initscripts
mv /etc/rc.conf /etc/backup-rc.conf # (If you dont want to return to full old fashioned config)
nano /etc/rc.local # (Put your stuff there, mount directly without a mount entry in fstab)

Welcome back to old school auto execution.

If you also want to automate the login process:
https://wiki.archlinux.org/index.php/Au ... al_console
Posts: 27
Joined: Mon Nov 05, 2012 7:25 pm
by pepedog » Mon Nov 05, 2012 10:30 pm
Initscripts is going,it was one of the things that attracted me to arch
https://www.archlinux.org/news/end-of-i ... s-support/

Here is how to get rc.local going again
https://bbs.archlinux.org/viewtopic.php?id=148170
I suppose you are mounting network stuff? Maybe mount -a in rc.local will mount ok second time around, keeping fstab the way you want
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by grimpirate » Wed Nov 07, 2012 4:34 am
I would suggest you create a bash shell script that inputs this command sequence for you. Then I would create a systemd service which executes that script. There's no need to use initscripts.
Posts: 38
Joined: Fri Oct 19, 2012 6:16 pm
by pepedog » Wed Nov 07, 2012 10:16 am
Personally, I would have used netcfg to bring up the wireless
https://wiki.archlinux.org/index.php/Netcfg
Note is systemd which recomends netcfg
https://wiki.archlinux.org/index.php/Systemd#Mixed_systemd.2Fsysvinit.2Finitscripts_installation
Warning: Systemd is an asynchronous starting process, compared to the sequential DAEMONS startup. In particular, network being a legacy service, may start too late to enable interfaces which are required by other services. You are advised to move to netcfg or NetworkManager before embarking to systemd.
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by grimpirate » Wed Nov 07, 2012 5:51 pm
You could also put that command sequence in your .bash_profile. That's how I do it. I don't remember the exact script but it also checks if the wireless interface is already up and running so as not to create an error every time I log in/out of the terminal. Of course, putting it in the .bash_profile means it will only work for that particular user, and you would have to grant this user the appropriate privileges.
Posts: 38
Joined: Fri Oct 19, 2012 6:16 pm
by grimpirate » Thu Nov 08, 2012 12:28 am
This is what I have in my .bash_profile in my user's home folder
Code: Select all
if ps ax | grep -v grep | grep wpa_supplicant > /dev/null
then
echo "Wireless connectivity enabled."
else
sudo wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
sudo dhcpcd wlan0 </dev/null >/dev/null 2>&1 &
fi
Posts: 38
Joined: Fri Oct 19, 2012 6:16 pm
by haroldjclements » Thu Nov 08, 2012 9:51 am
Thank you to everyone for helping me with this. I have not had time to play with my Pi, but when I do I will try some of the suggestions.

Thanks again, your help is appreciated...
Posts: 2
Joined: Sat Nov 03, 2012 3:37 pm
by cerien » Wed Jan 23, 2013 9:56 pm
I've been struggling with this issue and fixed it in some way....

Doing an ifdown wlan0 then ifup wlan0 was working, but the interface would not come up at boot time. I got the feeling that it was a delay thing.

I've edited /etc/network/if-up.d/wpasupplicant and added sleep 5 straight after the comments. It does now work.

Hope this helps,

J.
Posts: 1
Joined: Wed Jan 23, 2013 9:52 pm
by pepedog » Thu Jan 24, 2013 12:14 am
Apparently-
systemd is so fast it's trying to start the network before hardware is detected an module loaded
https://wiki.archlinux.org/index.php/Network_Configuration#Run_DHCP_at_boot
Tells you how to insert module quicker
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by sdjf » Sun Feb 17, 2013 4:28 am
Will this work with my usb0 network interface and not just wpasupplicant?

/etc/network/if-up.d/

And I do not have the above, I have not yet updated, is it in more recent image or a package that needs installing?
FORUM TIP: To view just one person's posting history, sign in, click on their user name, then click on "Search User's Posts." || This Pi owner is running Arch on 512MB Model B.
Posts: 1284
Joined: Fri Mar 16, 2012 5:20 am
Location: California