You are not logged in.

#1 2011-08-20 23:07:13

NegativeFPS
Member
From: 192.168.0.1
Registered: 2008-04-14
Posts: 37
Website

How to automate this Wireless setup at start up?

I'm using a WiFi card and after every reboot I have to enter "# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf" and then dhcpcd wlan0 for it to get DHCP info and connect.

How can this be automated?


Big Linux Noob

Offline

#2 2011-08-20 23:15:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to automate this Wireless setup at start up?

Are you running any DE / WM? General info about autostarting: https://wiki.archlinux.org/index.php/Autostarting
wpa_supplican management: https://wiki.archlinux.org/index.php/Wp … Management

Last edited by karol (2011-08-20 23:17:59)

Offline

#3 2011-08-20 23:52:39

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to automate this Wireless setup at start up?

Try adding

wpa_supplicant -Dwext -B -wlan0 -c/etc/wpa_supplicant.conf
dhcpcd wlan0

to /etc/rc.local (https://wiki.archlinux.org/index.php/Arch_Boot_Process)

Last edited by Earnestly (2011-08-21 00:00:59)

Offline

#4 2011-08-20 23:57:15

DaemonOfChaos
Member
From: Austin, TX
Registered: 2011-08-16
Posts: 12

Re: How to automate this Wireless setup at start up?

I installed Network Manager and it has worked good for me so far.

Offline

#5 2011-08-21 00:19:36

NegativeFPS
Member
From: 192.168.0.1
Registered: 2008-04-14
Posts: 37
Website

Re: How to automate this Wireless setup at start up?

Kaustic wrote:

Try adding

wpa_supplicant -Dwext -B -wlan0 -c/etc/wpa_supplicant.conf
dhcpcd wlan0

to /etc/rc.local (https://wiki.archlinux.org/index.php/Arch_Boot_Process)

Hey I tried that, and it works, but I'm not sure that's the perfect solution because when rebooting, it hangs for almost a minute on "start Network" (or whatever the phrasing is), so I think it isn't able to connect at that point, so it prolongs my boot time considerably, and only after it fails, it then goes to rc.local and launches the script, connecting me to the network.

So while it solves the problem, it doesn't seem to be the right way of approaching it =/


Big Linux Noob

Offline

#6 2011-08-21 00:51:41

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to automate this Wireless setup at start up?

Do you get any output from dmesg concerning network?

(rc.local should run after the initial daemon scripts. (https://wiki.archlinux.org/index.php/Autostarting))

Arch_Boot_Process wiki article wrote:

When editing this file [rc.local], keep in mind that it is run after the basic setup (modules/daemons), as the root user, and whether or not X starts.

Edit: A potential workaround to this could be to background the network daemon in your rc.conf DAEMON=( ... @network ... ) array. (https://bbs.archlinux.org/viewtopic.php?pid=975790 (Also search here for slow network daemon, plenty of results)

Last edited by Earnestly (2011-08-21 01:14:14)

Offline

#7 2011-08-21 01:02:02

NegativeFPS
Member
From: 192.168.0.1
Registered: 2008-04-14
Posts: 37
Website

Re: How to automate this Wireless setup at start up?

Kaustic wrote:

Do you get any output from dmesg concerning network?

(rc.local should run after the initial daemon scripts, so how it causes delay is unknown to me. (https://wiki.archlinux.org/index.php/Autostarting))

Arch_Boot_Process wiki article wrote:

When editing this file, keep in mind that it is run after the basic setup (modules/daemons), as the root user, and whether or not X starts.

Regarding the first question I'm not sure what you mean or how to check. dmesg lists my WiFi card if that's what you mean. WiFi works, it's just that I have/had to manually initiate the connection as mentioned earlier.

And no, I don't mean that rc.local is the one causing the delay. What I meant was that the delay is caused because I think the computer is trying to connect to the network during "starting network" phase of bootup, but is unable to. After a while it gives up, and since rc.local kicks in AFTER the network initiation phase, it connects then. What needs to happen is those commands should kick in somehow during the starting network but don't (just guessing here), and again, it just times out after trying for a while.

I'm terrible at explaining things. Sorry!

Last edited by NegativeFPS (2011-08-21 01:02:15)


Big Linux Noob

Offline

#8 2011-08-21 01:10:02

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to automate this Wireless setup at start up?

No problem, I did some major excavation work on my previous post too.

Out of curiosity, if you empty the rc.local, does network still take almost a minute to load?

Edit: Another rather major cause of slow network daemons is misconfiguration of your hostname and host in /etc/rc.conf & /etc/hosts respectively.

Last edited by Earnestly (2011-08-21 01:16:03)

Offline

#9 2011-08-21 01:24:18

NegativeFPS
Member
From: 192.168.0.1
Registered: 2008-04-14
Posts: 37
Website

Re: How to automate this Wireless setup at start up?

Yup, still takes that long to load if I empty rc.local

@ing the network part is a huge improvement, now it boots in seconds (although now I'm not able to use the net right after logging in. Need to wait a short while). I mean it's a solution, but a workaround as you said. But I'm still OCD about this and would like to get this down so that it finishes loading everything right during the network phase as it should, if possible

As for the hostnames, they both match

Of course, it's completely possible that that's just how long it takes the network part to load on any computer. I exaggerated when I said it takes a minute. It maybe pauses on the networking part for 15 or so seconds, but considering all other phases take one second to complete, it is a bit suspicious.

Last edited by NegativeFPS (2011-08-21 01:35:30)


Big Linux Noob

Offline

#10 2011-08-21 01:28:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to automate this Wireless setup at start up?

Even my plain old wired network takes a couple seconds to load itself, so '@network' lets me log in faster, but I still have to wait a bit before accessing the net.

Offline

#11 2011-08-21 01:35:37

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to automate this Wireless setup at start up?

Interestingly, /etc/rc.d/network has a few "ifconfig" commands which are no longer supported (and not included as default in base(-devel) anymore), do you happen to have the ifconfig package installed? If not, that may explain the issues.

Anyway, good luck and post the solution if you come across anything.

Last edited by Earnestly (2011-08-21 02:19:26)

Offline

#12 2011-08-21 01:44:11

NegativeFPS
Member
From: 192.168.0.1
Registered: 2008-04-14
Posts: 37
Website

Re: How to automate this Wireless setup at start up?

Kaustic wrote:

Interestingly, /etc/rc.d/network as a few "ifconfig" commands which are no longer supported (and not included in base(-devel) anymore), do you happen to have the ifconfig package installed? If not, that may explain the issues.

Anyway, good luck and post the solution if you come across anything.

That sounds logical. I don't have ifconfig, no. And Pacman does not carry it.

Is it a good number of commands that are no longer supported? If they aren't many, could you post them and I could possibly try removing them to see if that solves it

edit: ifconfig is present in net-tools. I installed net-tools (so now I got ifconfig), un-@ed network and now it takes a long time again, so that isn't it

Last edited by NegativeFPS (2011-08-21 01:46:59)


Big Linux Noob

Offline

#13 2011-08-21 01:49:49

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: How to automate this Wireless setup at start up?

My advice for this situation would be to just use netcfg. It's an awesome tool. But if you really insist on using the (apparently outdated, and even more apparently not used by Arch devs seeing as how they didn't notice this) network script, net-tools is the package that has ifconfig.

Offline

#14 2011-08-21 01:53:05

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to automate this Wireless setup at start up?

Here's a link to why ifconfig is no longer supported (but still available): http://www.archlinux.org/news/deprecation-of-net-tools/

Edit: Gusar makes a good point. https://wiki.archlinux.org/index.php/Netcfg

Last edited by Earnestly (2011-08-21 02:13:30)

Offline

Board footer

Powered by FluxBB