无法在日志中初始化控制接口/run/wpa_supplicant,但 wlan 可以工作

无法在日志中初始化控制接口/run/wpa_supplicant,但 wlan 可以工作

无线局域网工作正常,但我在 上有此日志条目journalctl -b -p 3。是什么原因造成的?

Dec 11 21:26:09 raspberrypi wpa_supplicant[440]: Failed to initialize control interface '/run/wpa_supplicant'.
                                                 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.
Dec 11 21:26:09 raspberrypi NetworkManager[433]: <error> [1607718369.9284] sup-iface[0x2a0450,wlan0]: error adding interface: wpa_supplicant couldn't grab this interfac

cat /etc/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
    ssid="foo"
    psk="bar"
}

答案1

您需要停止NetworkManager使用的服务wpasupplicant

sudo systemctl stop NetworkManager

杀死所有wpasupplicant实例:

sudo killall wpasupplicant

或者

sudo killall wpa_supplicant

要完全禁用该NetworkManager服务,请使用:

sudo systemctl disable NetworkManager

相关内容