Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] wpa_supplicant does not start
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ConiKost
Veteran
Veteran


Joined: 11 Jan 2005
Posts: 1360

PostPosted: Sat Mar 19, 2016 2:34 pm    Post subject: [SOLVED] wpa_supplicant does not start Reply with quote

Hi!
I am running Gentoo on my Raspberry Pi 3 and have installed wpa_supplicant, to be able to connect to my WiFi.

With using "iw scan", I can see my SSID.
There seems to be problem with sockets

wpa_supplicant cannot start, as it fails to start the control interface.
I think, it's not a problem of wpa_supplicant, but more there is something wrong with sockets, maybe eben some kernel option missing?
Code:

ctrl_iface bind(PF_UNIX) failed: Invalid argument


On my x86 Gentoo notebook, wpa_supplicant is running fine with that config.

Kernel is build from raspberrypi-sources (4.4.9999)

Code:

cd /usr/share/linux
KERNEL=kernel7
make zImage modules dtbs
sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img


This is the error during start of wpa_supplicant:

Code:

Using existing control interface directory.
ctrl_interface_group=10 (from group name 'wheel')
ctrl_iface bind(PF_UNIX) failed: Invalid argument
ctrl_iface exists, but does not allow connections - assuming it was leftover from forced program termination
Could not unlink existing ctrl_iface socket '/var/run/wpa_supplicant/wlan0': No such file or directory
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=wheel'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.


My wpa_supplicant configuration:
Code:

# Zugriff für Gruppe "wheel" erlauben
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1

# Battlestar Galactica (2.4 GHz, WPA2)
network={
        group=CCMP
        key_mgmt=WPA-PSK
        pairwise=CCMP
        priority=1
        proto=WPA2
        # psk="xxxxxx"
        psk=xxxxxx
        scan_ssid=1
        ssid="Battlestar Galactica"
}

# Battlestar Columbia (2.4 GHz, WPA2-EAP)
network={
        eap=TTLS
        group=CCMP
        identity="xxxxxxx"
        key_mgmt=WPA-EAP
        pairwise=CCMP
        password="xxxxxxxx"
        phase2="auth=MSCHAPV2"
        priority=2
        proto=WPA2
        scan_ssid=1
        ssid="Battlestar Columbia"
}


wpa_supplicant is running perfectly fine, if I disable completly the control interface. But Gentoo itself is setting "-W" on wpa_supplicant and wants the control interface.
Any Ideas?


Last edited by ConiKost on Sat Mar 19, 2016 4:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Mar 19, 2016 2:56 pm    Post subject: Re: wpa_supplicant does not start Reply with quote

ConiKost wrote:
Code:
You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.

ConiKost ... do you have both wpa_supplicant and net.wlan0 in the runlevel? If so, you shouldn't ... as you're effectively starting two wpa_supplicant processes. Either allow netifrc to start wpa_supplicant or run /etc/init.d/wpa_supplicant in isolation, or via dhcpcd.

So, using netifrc:
/etc/conf.d/net:
modules_wlan0="!plug wpa_supplicant dhcpcd"
wpa_supplicant_wlan0="-Dnl80211 -qq"
config_wlan0="dhcp"

... or remove net.wlan0 and add dhcpcd (or whatever dhcp client you use) to the runlevel.

Note that dhcpcd can also start wpa_supplicant if 10-wpa_supplicant is in /lib/dhcpcd/dhcpcd-hooks (see: 2016-01-08-some-dhcpcd-hooks-are-now-examples) ... which, if enabled, can also cause the above error, so similarly remove wpa_supplicant from the runlevel if this is the case.

HTH & best ... khay
Back to top
View user's profile Send private message
ConiKost
Veteran
Veteran


Joined: 11 Jan 2005
Posts: 1360

PostPosted: Sat Mar 19, 2016 3:10 pm    Post subject: Re: wpa_supplicant does not start Reply with quote

khayyam wrote:
ConiKost wrote:
Code:
You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.

ConiKost ... do you have both wpa_supplicant and net.wlan0 in the runlevel? If so, you shouldn't ... as you're effectively starting two wpa_supplicant processes. Either allow netifrc to start wpa_supplicant or run /etc/init.d/wpa_supplicant in isolation, or via dhcpcd.

So, using netifrc:
/etc/conf.d/net:
modules_wlan0="!plug wpa_supplicant dhcpcd"
wpa_supplicant_wlan0="-Dnl80211 -qq"
config_wlan0="dhcp"

... or remove net.wlan0 and add dhcpcd (or whatever dhcp client you use) to the runlevel.

Note that dhcpcd can also start wpa_supplicant if 10-wpa_supplicant is in /lib/dhcpcd/dhcpcd-hooks (see: 2016-01-08-some-dhcpcd-hooks-are-now-examples) ... which, if enabled, can also cause the above error, so similarly remove wpa_supplicant from the runlevel if this is the case.

HTH & best ... khay


Hi!
No, wpa_supplicant ist NOT in a runlevel and NOT running. So the message does not apply to me.
I am currently debugging, why wpa_supplicant does not want to start :(
I am starting wpa_supplicant over netifrc. But that fails with that error, which I've posted.

At least, I don't think this a problem with wpa_supplicant. I've also discovered, that my logger (metalog) also does not work:
Code:

# metalog
metalog: Unable to bind a local socket: Invalid argument
metalog: error: Unable to bind sockets


So there is something completly wrong with sockets. Could be a kernel option be missing?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Mar 19, 2016 3:37 pm    Post subject: Re: wpa_supplicant does not start Reply with quote

ConiKost wrote:
So there is something completly wrong with sockets. Could be a kernel option be missing?

ConiKost ... possibly, is CONFIG_UNIX (Unix domain sockets) enabled?

best ... khay
Back to top
View user's profile Send private message
ConiKost
Veteran
Veteran


Joined: 11 Jan 2005
Posts: 1360

PostPosted: Sat Mar 19, 2016 3:46 pm    Post subject: Re: wpa_supplicant does not start Reply with quote

khayyam wrote:
ConiKost wrote:
So there is something completly wrong with sockets. Could be a kernel option be missing?

ConiKost ... possibly, is CONFIG_UNIX (Unix domain sockets) enabled?

best ... khay


CONFIG_UNIX=y ist set in my kernel config.
Back to top
View user's profile Send private message
ConiKost
Veteran
Veteran


Joined: 11 Jan 2005
Posts: 1360

PostPosted: Sat Mar 19, 2016 4:27 pm    Post subject: Reply with quote

Thats funny.. I've got the cause.

I am using currently -mstructure-size-boundary=32 in my CFLAGS. That one seems to be the cause.
When setting to 8 oder removing it, and recompile metalog/wpa_supplicant, the both start working and don't have any socket problems any more.

I don't have an explanation for this, but I got this option recomended last year by some gcc-folks for linuxARM for better performance.

Code:

The sizes of all structures and unions are rounded up to a multiple of the number of bits set by this option. Permissible values are 8, 32 and 64. The default value varies for different toolchains. For the COFF targeted toolchain the default value is 8. A value of 64 is only allowed if the underlying ABI supports it.
Specifying a larger number can produce faster, more efficient code, but can also increase the size of the program. Different values are potentially incompatible. Code compiled with one value cannot necessarily expect to work with code or libraries compiled with another value, if they exchange information using structures or unions.


At least, I don't think, this is an incompatibility, as my whole system and kernel was compiled without any errors.
Other packages are working perfectly fine. Anyway, the RPi3 is just my dev and play board, so I know the cause ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum