在我的 Microsoft Surface Pro 6 上设置 Linux“Arch”,安装正常,但 wpa_supplicant 作为服务存在问题。服务已启用,但无法在启动时启动。以 root 身份登录后,“systemctl start wpa_supplicant.service”运行良好。这似乎是时间问题(对我来说),但我无法使用 WiKi 或 Google 来帮助自己。任何帮助都值得感激。
/etc/wpa_supplicant.conf
network={
ssid="MyWiFi"
psk=be131c51e250735aab71b89563250cba1e13e513ce53e037cd2351791dd07c52
}
/etc/systemd/system/wpa_supplicant.service
[Unit]
Description=WPA supplicant
Before=network.target
Wants=network.target
[Service]
Type=dbus
BusName=fi.w1.wpa_supplicant1
ExecStart=/usr/bin/wpa_supplicant -u -i wlp1s0 -c /etc/wpa_supplicant.conf
[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service
journalctl(启动后)
-- Logs begin at Thu 2019-08-01 03:57:36 MST, end at Fri 2019-08-02 05:28:18 MST. --
Aug 02 05:27:41 surface systemd[1]: Starting WPA supplicant...
Aug 02 05:27:41 surface wpa_supplicant[462]: Successfully initialized wpa_supplicant
Aug 02 05:27:41 surface systemd[1]: Started WPA supplicant.
Aug 02 05:27:41 surface wpa_supplicant[462]: Could not read interface wlp1s0 flags: No such device
Aug 02 05:27:41 surface wpa_supplicant[462]: nl80211: Driver does not support authentication/association or connect commands
Aug 02 05:27:41 surface wpa_supplicant[462]: nl80211: deinit ifname=wlp1s0 disabled_11b_rates=0
Aug 02 05:27:41 surface wpa_supplicant[462]: Could not read interface wlp1s0 flags: No such device
Aug 02 05:27:41 surface wpa_supplicant[462]: wlp1s0: Failed to initialize driver interface
Aug 02 05:27:41 surface systemd[1]: wpa_supplicant.service: Main process exited, code=exited, status=255/EXCEPTION
Aug 02 05:27:41 surface systemd[1]: wpa_supplicant.service: Failed with result 'exit-code'.
journalctl(手动启动服务后)
-- Logs begin at Thu 2019-08-01 03:57:36 MST, end at Fri 2019-08-02 05:28:55 MST. --
Aug 02 05:28:51 surface systemd[1]: Starting WPA supplicant...
Aug 02 05:28:51 surface wpa_supplicant[505]: Successfully initialized wpa_supplicant
Aug 02 05:28:51 surface systemd[1]: Started WPA supplicant.
Aug 02 05:28:55 surface wpa_supplicant[505]: wlp1s0: Trying to associate with e0:3f:49:9b:4f:e8 (SSID='MyWiFi' freq=2437 MHz)
Aug 02 05:28:55 surface wpa_supplicant[505]: wlp1s0: Associated with e0:3f:49:9b:4f:e8
Aug 02 05:28:55 surface wpa_supplicant[505]: wlp1s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Aug 02 05:28:55 surface wpa_supplicant[505]: wlp1s0: WPA: Key negotiation completed with e0:3f:49:9b:4f:e8 [PTK=CCMP GTK=CCMP]
Aug 02 05:28:55 surface wpa_supplicant[505]: wlp1s0: CTRL-EVENT-CONNECTED - Connection to e0:3f:49:9b:4f:e8 completed [id=0 id_str=]
答案1
你没有指定什么时候启动服务,所以启动得太早了;它说“wlp1s0 不存在”,因为该接口在那个时间点确实还不存在。
推荐的方法是使用:
[Unit]
Requires=sys-subsystem-net-devices-wlp1s0.device
After=sys-subsystem-net-devices-wlp1s0.device
这也是库存[email protected]
解决问题的方法(您可以简单地使用该单位,而不是自己制作)。