You are not logged in.

#1 2011-06-21 13:10:50

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

[Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

Everything around here seems to be breaking these days... Anyways.

I upgraded netcfg yesterday. Today I fire up my laptop, but no wireless. I run netcfg again, this is what wpa_supplicant spits out:

# netcfg intel
:: intel up                                                                                                                                                        [BUSY]
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
^C

The funny thing is, nothing's changed in the netcfg config file, which looks like this:

CONNECTION="wireless"
INTERFACE="intel"
HOSTNAME="hermes"

# AP authentication
SCAN="yes"
SECURITY="wpa-config"
WPA_CONF="/etc/wpa_supplicant.conf"
WPA_OPTS="-Dwext -B"
ESSID="Zeus 802.11n"

# IP address
IP="dhcp"
DHCP_TIMEOUT=10

I compared my config to the examples that come with netcfg - just to be sure nothing's changed that I wasn't aware of - but it looks pretty identical. Oddly enough, calling wpa_supplicant and then dhcpcd directly just connects me to my WLAN, like netcfg used to be able to do.

For reference, netcfg seems to call wpa_supplicant like this, going by htop's output:

wpa_supplicant -Dwext,nl80211 -c /etc/wpa_supplicant.conf -B -i intel -d

When run separately, however, that works just fine, just like using -Dwext like I used to do before.

Last edited by .:B:. (2011-06-21 22:29:55)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2011-06-21 20:43:11

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

Hmm, what is the value of

ctrl_interface

from your /etc/wpa_supplicant.conf? Also, intel is your interface name... wierd.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#3 2011-06-21 20:46:16

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

$ grep ctrl_interface /etc/wpa_supplicant.conf 
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
$ ls -lh /var/run/wpa_supplicant/*
srwxrwx--- 1 root wheel 0 22 jun  2011 /var/run/wpa_supplicant/intel

I renamed my interfaces so they're easier to tell apart.

Either way, both netcfg and wpa_supplicant itself call the same configuration file, so that leads me to believe the error is with netcfg.

Last edited by .:B:. (2011-06-21 20:48:36)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2011-06-21 21:02:30

scruffidog
Member
Registered: 2010-01-10
Posts: 26

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

same problem here. tracked the change to /usr/lib/network/globals where the STATE_DIR variable is now set to /run/network whereas previously it was point to /var/run.

what necessitated the change ? I'm not against change, just like to have a headsup and also understand the reasonings, especially in subsystems that has been stable for quite some time.

I mean I can fix this, but it is very annoying when there is suddenly a new convention that breaks things in unexpected places. Arch is great since things WORK without any major cruft but it would be nice to have some warning about this beforehand.

Offline

#5 2011-06-21 21:07:03

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

My understanding is that the thing fails in start_wpa(). From /usr/lib/network/8021x:

start_wpa()
{
    local INTERFACE="$1" WPA_CONF="$2" WPA_DRIVER="$3"
    shift 3
    local WPA_OPTS="$*"

    wpa_supplicant -B -P "/run/wpa_supplicant_${INTERFACE}.pid" -i "$INTERFACE"-D "$WPA_DRIVER" -c "$WPA_CONF" $WPA_OPTS
    sleep 1

    if [[ ! -f "/run/wpa_supplicant_${INTERFACE}.pid" ]]; then
        return 1
    fi
}

So, you should have seen "-P' in htop, no? Have you tried w/o WPA_OPTS?

EDIT: OK, I was wrong. The error seems to come from wpa_supplicant/wp_cli calls with the new /run standard:

arch~> grep "/run/wpa_supplicant" ./usr/lib/network/8021x
WPA_CLI="wpa_cli -p /run/wpa_supplicant"
    wpa_supplicant -B -P "/run/wpa_supplicant_${INTERFACE}.pid" -i "$INTERFACE" -D "$WPA_DRIVER" -c "$WPA_CONF" $WPA_OPTS
    if [[ ! -f "/run/wpa_supplicant_${INTERFACE}.pid" ]]; then
    if [[ -f "/run/wpa_supplicant_$1.pid" ]]; then
        kill "$(cat "/run/wpa_supplicant_$1.pid")" &>/dev/null &
    wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/run/wpa_supplicant -P/run/wpa_supplicant.pid || return 1
    kill "$(cat /run/wpa_supplicant.pid)"
    echo "ctrl_interface=/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf"    # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted

Could you change the ctrl_interface to to /run/wpa_supplicant in /etc/wpa_supplicant.conf?

Last edited by Leonid.I (2011-06-21 21:19:59)


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#6 2011-06-21 22:29:19

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

Thanks Leonid, that fixed it smile.

Scruffidog: I agree, hardcoding this seems a little extreme. I don't know what prompted the move to /run, the daemons seem to be located there as well now... I thought that stuff belonged in /var. 'Volatile' stuff should go there, as far as I know.

Last edited by .:B:. (2011-06-21 22:31:28)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2011-06-22 15:41:05

scruffidog
Member
Registered: 2010-01-10
Posts: 26

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

yup...seems like the young whippersnappers of today are not aware or ignoring the lessons, experiences and application of said knowledge from when unix was first built. Things like separation of OS, applications and data into their own partitions, security, scaleable management, etc. I blame MSFT and a maximalist equipment philosophy for much of the bad practices that is now prevalent.

I guess /run is in prep of systemd which makes many assumptions, some which ignores configurations discribed above.

Offline

#8 2011-06-22 23:07:51

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [Solved] Netcfg 2.6.1 - suddenly fails to associate with WPA2 network

Been described in the mailing list, though its over my head. All the major distros are doing it, so I got the feeling we're just tagging along.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB