Home | News | Download | Packages | Forum | Wiki | Github

Wpa_supplicant and dhcpcd require restart after reboot



After rebooting, both wpa_supplicant and dhcpcd services need to be restarted, in order for wpa_supplicant to connect to a network specified in /etc/wpa_supplicant/wpa_supplicant.conf. After restarting the services behavior is as expected, automatically connecting to a network in range.

Behaviour changed in dhcpcd-6.10.0-1: The hook is not enabled by default anymore. […] If you’re using 6.10.0-1 or newer you have to enable the wpa_supplicant hook:

$ sudo ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/libexec/dhcpcd-hooks

This wiki page

This is confusing because that link already exists. Does that mean it can be safely removed? Should the wiki or template be updated? What was the reason for this change? (Edit: Deleting the link gives expected behavior after reboot.)

This message is repeated about every second in /var/log/socklog/daemon/current:

2017-09-10T18:44:37.93203 daemon.err: Sep 10 18:44:37 wpa_supplicant[1704]: Failed to initialize control interface '/run/wpa_supplicant'.
2017-09-10T18:44:37.94197 daemon.notice: Sep 10 18:44:37 wpa_supplicant[1704]: nl80211: deinit ifname=wlp3s0 disabled_11b_rates=0
2017-09-10T18:44:38.95259 daemon.notice: Sep 10 18:44:38 wpa_supplicant[1705]: Successfully initialized wpa_supplicant
2017-09-10T18:44:38.97201 daemon.notice: Sep 10 18:44:38 wpa_supplicant[1705]: ctrl_iface exists and seems to be in use - cannot override it
2017-09-10T18:44:38.97206 daemon.notice: Sep 10 18:44:38 wpa_supplicant[1705]: Delete '/run/wpa_supplicant/wlp3s0' manually if it is not used anymore
$ iw dev | grep Interface
        Interface wlp3s0
$ dhcpcd --version | head -1
dhcpcd 6.11.5
$ xbps-query -f dhcpcd | grep wpa
/usr/libexec/dhcpcd-hooks/10-wpa_supplicant -> /usr/share/dhcpcd/hooks/10-wpa_supplicant







It seems to me that the problem is the interaction between the two daemons. Are there any other relevant files except /usr/share/dhcpcd/hooks/10-wpa_supplicant?

[Solved[ No Sound, reinstall with Cinnamon image
"Not connected." when trying to connect wireless network
[SOLVED] I'm a newbie and i have problems setting up my wifi card
[SOLVED] (newbie) wpa_supplicant troubles
Last Kernel and Internet
(Jacob Moen) #2

I can’t offer any advice regarding wpa_supplicant and friends, but I desperately tried for over an hour to make it work (including multiple reboots) and numerous Interweb-searches, and decided to remove the two services (dhcpdp and wpa_supplicant) and simply install NetworkManager instead.

It took me 2 minutes to add, configure and enable WiFi in the NetworkManager.

Wpa_supplicant ?
No, I don’t want to go there …


As a Void user, I am decidedly not using anything Gnome, FreeDesktop or Red Hat had their fingers in. :wink:

After deleting the link, the connection seems more unstable, and DHCP seems to be reconfigured everytime something breaks. This might be my ISP but time will tell.


This was changed in the last dhcpcd update, the hook is activated by default again.
You can either disable the hook with the dhcpcd -C/–nohook option https://man.voidlinux.eu/dhcpcd#C or disable the wpa_supplicant runit service.
Using both makes it conflict and is probably the source of your problem.


I used the -C option like below and it now connects automatically after reboot. Thanks!


OPTS="-M -C wpa_supplicant"

Last Kernel and Internet

Hi jacmoe
How exactly did you remove the services dhcpdp and wpa_supplicant? According to the wiki disabling services?

rm /var/service/dhcpdp

rm /var/service/wpa_supplicant


If you want to get your wifi working either disable the wpa_supplicant service or the dhcpcd hook to wpa_supplicant, don’t disable both.

sudo rm /var/service/wpa_supplicant


OPTS="-M -C wpa_supplicant"

in /etc/sv/dhcpcd/conf

EDIT: Or do you want to disable both and use Network manager?


Actually I would like to use nm or wicd. Fortunately I have found the command rm -f /var/service/{dhcpcd,wpa_supplicant} How to replace NetworkManager with wicd?
The adapter sees the ssid, I click “connect”, followed by the message “validating authentication”, but then I get the message “connection failed”, “bad password”. It’s an old HP dual core SFF with usb 2.0 and a RTL8192EU usb wlan adapter. I’ve also tried with a RT 2570 usb adapter from Netopia: no difference.
My user is part of the group users and I have enabled dbus and wicd services. By the way: nm is uninstalled.


Sorry, I use neither…
I use wpa_supplicant and dhcpcd


Thanks anyway. In the meantime (Ubuntu-wiki) I realized, that wicd does not support wpa2 aes without some modifications… So I will try again wpa_supplicant and dhcpd.


Have a look here [SOLVED] I'm a newbie and i have problems setting up my wifi card

Hopefully, this can help!

(Edmond Dantes ) #12

Try Wicd (+ either wicd-gtk or wicd-qt, depending on what DE/WM you’re on) if you like easy to configure NMs with systray applet support. It’s lighter than NetworkManager and easier to trubleshoot, as documentation is really detailed

Personally I like wpa_gui as simple wpa_supplicant fronted. If anything goes wrong(rare case) all I need to do is edit wpa_supplicant.conf to set the correct options for the connection of interest


Hi there
I succeeded with networkmanager after the installation of linux-firmware
xbps-install -S linux-firmware

The Ubuntu-wiki includes a hint, that the support of the relevant card modules by the kernel itself does not allways work.
I might test wpa_gui and uninstall networkmanager later, thanks for mentioning wpa_gui Montecristo!

There is one question left, before I try wpa_gui. My encryption is wpa2 + aes. Would it be possible to add a wpa_supplicant.conf in the void wiki for this encryption, please? There is only an example for WPA-PSK.

Sorry, forgot to mention the usb wlan adapter: Ralink Technology, Corp. MT7601U, which works fine now.