Subject: wpa_supplicant not starting from /etc/init.d/wpa_supplicant but works by hand

From: David Demelier <[email-masked]>
Date: Tue, 7 Jul 2020 15:13:32 +0200

Hello there,

I'm facing a very strange issue on my RaspberryPi 4 runing Alpine Linux
3.12 in aarch64 architecture.

I've enable wpa_supplicant in default runlevel but it does not start
correctly at boot and the /var/log/messages is spammed with this:

Jul  2 22:41:42 figue daemon.info supervise-daemon[2688]: Supervisor command line: supervise-daemon wpa_supplicant --start /sbin/wpa_supplicant -- -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.info supervise-daemon[2690]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2690, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2695]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2695, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2696]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2696, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2697]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2697, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2698]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2698, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2699]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2699, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2700]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2700, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2701]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2701, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2702]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2702, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2703]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2703, exited with return code 255
Jul  2 22:41:42 figue daemon.info supervise-daemon[2704]: Child command line: /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: /sbin/wpa_supplicant, pid 2704, exited with return code 255
Jul  2 22:41:42 figue daemon.warn supervise-daemon[2689]: respawned "/sbin/wpa_supplicant" too many times, exiting

On the other hand, if I exactly run this command as root, it works fine:

# RC_SVCNAME=wpa_supplicant supervise-daemon wpa_supplicant --start /sbin/wpa_supplicant -- -iwlan0 -c /etc/wpa_supplicant/wpa_suppliant.conf

Then in /var/log/messages I get:

Jul  2 22:42:49 figue daemon.info supervise-daemon[2709]: Supervisor command line: supervise-daemon wpa_supplicant --start /sbin/wpa_supplicant -- -iwlan0 -c /etc/wpa_supplicant/wpa_suppliant.conf
Jul  2 22:42:49 figue daemon.info supervise-daemon[2711]: Child command line: /sbin/wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_suppliant.conf
Jul  2 22:42:54 figue daemon.info [2463]: wlan0: carrier acquired
Jul  2 22:42:54 figue daemon.info [2463]: wlan0: connected to Access Point `Livebox-5XY6'
Jul  2 22:42:54 figue daemon.info [2463]: wlan0: IAID 32:38:32:ea
Jul  2 22:42:54 figue daemon.info [2463]: wlan0: adding address fe80::b549:393:a809:cc23
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: rebinding lease of 192.168.1.17
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: carrier lost
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: deleting address fe80::b549:393:a809:cc23
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: carrier acquired
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: IAID 32:38:32:ea
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: adding address fe80::b549:393:a809:cc23
Jul  2 22:42:55 figue daemon.info [2463]: wlan0: soliciting an IPv6 router
Jul  2 22:42:56 figue daemon.info [2463]: wlan0: rebinding lease of 192.168.1.17
Jul  2 22:42:56 figue daemon.info [2463]: wlan0: probing address 192.168.1.17/24
Jul  2 22:42:57 figue daemon.info [2463]: wlan0: Router Advertisement from fe80::3293:bcff:fe01:2cd0
Jul  2 22:42:57 figue daemon.info [2463]: wlan0: adding address 2a01:cb10:185:7f00:9dbe:f0d0:144c:83e0/64
Jul  2 22:42:57 figue daemon.info [2463]: wlan0: adding route to 2a01:cb10:185:7f00::/64
Jul  2 22:42:57 figue daemon.info [2463]: wlan0: requesting DHCPv6 information
Jul  2 22:42:57 figue daemon.info [2463]: wlan0: adding default route via fe80::3293:bcff:fe01:2cd0
Jul  2 22:43:01 figue daemon.info [2463]: wlan0: leased 192.168.1.17 for 86400 seconds
Jul  2 22:43:01 figue daemon.info [2463]: wlan0: adding route to 192.168.1.0/24
Jul  2 22:43:01 figue daemon.info [2463]: wlan0: adding default route via 192.168.1.1

The only thing I've edited is to disable dbus in
/etc/conf.d/wpa_supplicant, the config file looks like this:

    wpa_supplicant_args=""
    wpa_supplicant_dbus=no

Any ideas what's going on here? I've tried some googl'ing but was unable
to find a similar issue.

Regards,

-- 
David