View previous topic :: View next topic |
Author |
Message |
abduct Apprentice

Joined: 19 Mar 2015 Posts: 207
|
Posted: Sun Mar 11, 2018 5:48 pm Post subject: wpa_supplicant weird behaviour not honoring net.wlan0 |
|
|
I am playing with wpa_supplicant after setting it up according to the wiki, but there are a few things that seem to go wrong that I have to manually correct.
For instance on boot wpa_supplicant is started with these flags:
Code: | # ps aux | grep wpa
/usr/sbin/wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_supplicant.conf -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 |
and when I use wpa_cli to setup and enable a network the wlan0 interface connects and authenticates, but does not retrieve an IP address.
I have to run
Code: |
# rc-service net.wlan0 restart
* Bringing up interface wlan0
* Starting wpa_supplicant on wlan0 ...
Successfully initialized wpa_supplicant
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
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.
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
* start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant' [ !! ]
* ERROR: net.wlan0 failed to start
# killall wpa_supplicant
# rc-service net.wlan0 restart
* Bringing up interface wlan0
* Starting wpa_supplicant on wlan0 ...
Successfully initialized wpa_supplicant [ ok ]
* Starting wpa_cli on wlan0 ... [ ok ]
* Backgrounding ... ...
* WARNING: net.wlan0 has started, but is inactive
|
in order for the service to restart properly and allow the interface to obtain an IP address.
After the above the wpa_supplicant is started as
Code: | ]# ps aux | grep wpa
/usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -W -B -i wlan0 -P /run/wpa_supplicant-wlan0.pid
/usr/bin/wpa_cli -a /etc/wpa_supplicant/wpa_cli.sh -p /var/run/wpa_supplicant -i wlan0 -P /run/wpa_cli-wlan0.pid -B
|
So here are a few questions:
-Why does the wiki specify the -M options in /etc/conf.d/wpa_supplicant? `man wpa_supplicant' does not list this option at all. What does it even do?
-How can I remove this weird auto startup of wpa_supplicant and use only the net.wlan0 service? I have the net.wlan0 rc set to run at the default run level along with net.eth0. I have a feeling the net.wlan0 service is launching some kind of dhcp service along side wpa_supplicant/wpa_cli where as what ever is starting the wpa_supplicant daemon first is not.
Here are my current configs for wpa_supplicant:
Code: | # cat /etc/conf.d/wpa_supplicant
# conf.d file for wpa_supplicant
#
# Please check man 8 wpa_supplicant for more information about the options
# wpa_supplicant accepts.
#
wpa_supplicant_args="-B -M -c/etc/wpa_supplicant/wpa_supplicant.conf"
|
Code: | # cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1
network={
ssid="ssid"
psk="passphrase"
}
|
Thanks for any information |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sun Mar 11, 2018 9:08 pm Post subject: |
|
|
abduct wrote: | Code: | # rc-service net.wlan0 restart
* Bringing up interface wlan0
* Starting wpa_supplicant on wlan0 ...
[...]
# rc-service net.wlan0 restart
* Bringing up interface wlan0
* Starting wpa_supplicant on wlan0 ...
Successfully initialized wpa_supplicant [ ok ] |
|
abduct ... you have wpa_supplicant and net.wlan0 in the runlevel (hence there being a cntl_interface in existance on initalisation), you should only have net.wlan0, it will start wpa_supplicant (if configured to do so via 'modules_wlan0='). Note that the configuration /etc/conf.d/wpa_supplicant is only used by wpa_supplicant (the service) and so you should configure via /etc/conf.d/net, eg:
Code: | modules_wlan0="wpa_supplicant dhcpcd"
wpa_supplicant_wlan0="-Dnl80211 -qq"
config_wlan0="dhcp" |
Also, why start both the wired and the wireless interface?
HTH & best ... khay |
|
Back to top |
|
 |
abduct Apprentice

Joined: 19 Mar 2015 Posts: 207
|
Posted: Sun Mar 11, 2018 10:25 pm Post subject: |
|
|
@khayyam
Thanks for that, I didn't notice that wpa_supplicant was in the default runlevel for some reason. I've also corrected my /etc/conf.d/net to include a few more options.
I will reboot and check to see all is well after my updates are done.
As for starting both wired and wireless services, I use both on my laptop depending on where I am. I prefer to use wired over wireless when ever it is convenient for me.
Is this a bad thing? |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Mar 12, 2018 9:44 am Post subject: |
|
|
abduct wrote: | As for starting both wired and wireless services, I use both on my laptop depending on where I am. I prefer to use wired over wireless when ever it is convenient for me. Is this a bad thing? |
abduct ... it can be, and so you're best to use 'plug' (via sys-apps/ifplugd, or sys-apps/netplug), eg:
/etc/conf.d/net: | modules_eth0="plug dhcpcd"
modules_wlan0="plug wpa_supplicant dhcpcd" |
This would then bring up the wired interface/service based on cable connection, switching to wireless when disconnected.
HTH & best ... khay |
|
Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6818 Location: Blighty
|
|
Back to top |
|
 |
|