wpa_supplicant fails .. but works? Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Narfel
Posts: 17
Joined: Wed Jan 31, 2018 10:19 am

wpa_supplicant fails .. but works?

Post by Narfel »

Hi pretty people,
i'm running the current dietpi on a rPi0w and get the constant warning from systemctl that my wpa_service failed.

Code: Select all

$ sudo systemctl --failed
  UNIT                   LOAD   ACTIVE SUB    DESCRIPTION
● wpa_supplicant.service loaded failed failed WPA supplicant

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
asking for the status gives:

Code: Select all

$ sudo systemctl status wpa_supplicant
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-03-20 09:15:02 CET; 33min ago
 Main PID: 201 (code=exited, status=255)

Mar 20 09:15:01 Erdbeere systemd[1]: Starting WPA supplicant...
Mar 20 09:15:02 Erdbeere wpa_supplicant[201]: dbus: Could not acquire the system bus: org.freedesktop.DBus.Error.FileNotFound - Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Mar 20 09:15:02 Erdbeere systemd[1]: wpa_supplicant.service: Main process exited, code=exited, status=255/n/a
Mar 20 09:15:02 Erdbeere systemd[1]: Failed to start WPA supplicant.
Mar 20 09:15:02 Erdbeere systemd[1]: wpa_supplicant.service: Unit entered failed state.
Mar 20 09:15:02 Erdbeere systemd[1]: wpa_supplicant.service: Failed with result 'exit-code'.
Yet, since i'm getting these outputs via ssh using wlan0 it is working. I'm not really sure how to troubleshoot this since killing wpa_supplicant would kick me out. Any ideas what to do? Or can i simply ignore it?

Not sure if this is related, but one of the above messages refers to dbus. When i try to autocomplete sudo systemctl some-servi... it breaks with the below message:

Code: Select all

 $ sudo systemctl status ama<here i press tab> Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
Any help appreciated.
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: wpa_supplicant fails .. but works?

Post by MichaIng »

@Narfel
wpa_supplicant.service should not be enabled or run. The networking solution on Debian (using ifupdown package) starts wpa_supplicant on a per-interface basis, when a certain network interface/adapter is initiated. This is also the reason why WiFi works, even that this service fails. It is simply not required.

I remember another case where this service was somehow enabled and added a step to our image creation script to disable it in ay case.

So please run: systemctl disable wpa_supplicant and you are fine :).
Narfel
Posts: 17
Joined: Wed Jan 31, 2018 10:19 am

Re: wpa_supplicant fails .. but works?

Post by Narfel »

Thank you very much :)

Just had another look, is it possible that it is attempting because of this dietpi-wifi-monitor.service?

Code: Select all

             └─dietpi-wifi-monitor.service
               ├─  823 /bin/bash /var/lib/dietpi/services/dietpi-wifi-monitor.sh
               ├─ 4654 sleep 10
               ├─20258 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
               └─20302 /sbin/dhclient -4 -v -pf /run/dhclient.wlan0.pid -lf /var/lib/dhcp/dhclient.wlan0.leases -I -df /var/lib/dhcp/dhclient6.wlan0.leases wlan0
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: wpa_supplicant fails .. but works?

Post by MichaIng »

Nope that is all fine. As you can see the wpa_supplicant instance is only for the wlan0 interface, similar to the DHCP dhclient below. But the wpa_supplicant.service is not active.

This is the expected behaviour if an interface is initiated via e.g. ifup wlan0.
"ifupdown" has an internal trigger system that starts wpa_supplicant automatically for WiFi interfaces and dhclient automatically for interfaces configured to use DHCP.

In this case dietpi-wifi-monitor.service did it's job and re-connected WiFi (ifup wlan0) after it detected a connection loss.
Post Reply