Linux Arch:dhcpcd 无法启动无线服务,尽管之前可以工作

Linux Arch:dhcpcd 无法启动无线服务,尽管之前可以工作

我的计算机上只有无线服务(我无法物理移动它来连接以太网)。

当我启动 Linux 时,我看到一条错误消息:(我用 替换了 wlp0...)

    [FAILED] Failed to start dhcpcd on <mywirelessinterface>. See 'systemctl status dhcpcd@<mywirelessinterface>.service’ for details.

好的,我这样做:

    # systemctl status dhcpcd@<mywirelessinterface>.service

    * dhcpcd@<mywirelessinterface>.service - dhcpcd on <mywirelessinterface>
    Loaded: loaded (/usr/lib/system/system/[email protected]: enabled)
    Active: failed (Result: resources) since <recent date and time>
    Process: 2918 ExecStart=/usr/bin/dhcpcd -q -w %I (code=exited, status=0/SUCCESS)

    <Current date and time> localhost system[1]: PID file /run/dhcpcd-<mywirelessinterface>.pid not readable (yet?) after start.
    <Current date and time> localhost system[1]: Failed to start dhcpcd on <mywirelessservice>.
    Failed to start dhcpcd on <mywirelesscervice>.
    <Current date and time> localhost system[1]: Unit dhcpcd@<mywirelessinterface>.service entered failed state.

当我使用 sudo su 手动启动它时:

    # systemctl start dhcpcd@<mywirelessinterface>.service

它以同样的方式失败:

      Job for dhcpcd@<mywirelessinterface>.service failed. See ‘systemctl status netctl@<mywirelessinterface>\x2<mynetworkname>.service’ and ‘journalctl –xn’ for details.

日记中是这样说的:

    # journalctl -xn

    -- Logs begin at <date, time>, end at <date, time>. --
    <Current date and time> localhost dhcpcd[4366]: <mywirelessinterface> failed to start wpa_supplicant
    <Current date and time> localhost dhcpcd[4367]: <mywirelessinterface> sucessfully initialized wpa_supplicant
    Line 1062: unknown EAP method 'SIM'. You may need to add support for this EAP method during wpa_supplicant build time configuration. See README for more information.
    Line 1062: failed to parse eap 'SIM'.
    Line 1065: failed to parse network block.
    Line 1072: unknown EAP method 'PSK'. You may need to add support for this EAP method during wpa_supplicant build time configuration. See README for more information.
    Line 1072: failed to parse eap 'PSK'.
    Line 1076: failed to parse network block.
    Line 1108: unknown EAP method 'IKEV2'. You may need to add support for this EAP method during wpa_supplicant build time configuration. See README for more information.
    Line 1108: failed to parse eap 'IKEV2'.
    Line 1111: failed to parse network block.
    Failed to read or parse configuration 'etc/wpa_supplicant/wpa_supplicant.conf'.
    <Current date and time> localhost dhcpcd[213]: <mywirelessinterface>: waiting for carrier
    <Current date and time> localhost dhcpcd[213]: <myotherinterface>: waiting for carrier
    <Current date and time> localhost dhcpcd[213]: control command: /usr/sbin/dhcpcd -k <myotherinterface>
    <Current date and time> localhost dhcpcd[213]: <myotherinterface> removing interface
    <Current date and time> localhost kernel: IPv6: ADDRCONF(NETDEV_UP): <mywirelessinterface>: link is not ready
    <Current date and time> localhost kernel: ieee80211 phy0: rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 10 in queue 0
    <Current date and time> localhost kernel: ieee80211 phy0: rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 10 in queue 0
    <Current date and time> localhost kernel: ieee80211 phy0: rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for entry 10 in queue 0

我确实尝试过 ip link, iw dev

     ip link set <mywirelessinterface> up

没有帮助。我还没有使用过 /etc/dhcpcd.conf,也不知道是否存在 wpa_supplicant 配置文件。我只是不知道它们是什么。救命!!!

答案1

基本上,这是 wpa_supplicant 的问题:默认的 /etc/wpa_supplicant.conf 基本上都是关于文档的,它是不是一个有效的配置文件。以下是有效文件的简单示例:

 ctrl_interface=/var/run/wpa_supplicant
 ap_scan=1
 fast_reauth=0
 network={
    ssid="WifiNetworkName"
    key_mgmt=WPA-PSK
    psk="WifiNetworkPassword"
    priority=5
 }

您可能希望保留旧版本(例如,只需将其重命名为 /etc/wpa_supplicant_old.conf),因为它包含许多有用的示例。

或者,您可以通过安装网络管理器让生活变得更简单:有很多,netctl、wicd,我个人更喜欢 NetworkManager。您可以找到在 Wiki 中您需要的所有说明。只需记住禁用试图为您管理连接的任何其他服务,您可以使用命令列出所有启用的服务

  sudo systemctl --type=service

答案2

dhcpcd我遇到了类似的问题。我有一个 wifi 配置文件,但在有线网络上启动后它无法启动。

为了解决这个问题,我禁用了所有dhcpcd服务netctl并重新启动了系统;然后它重新读取了 wifi 配置文件并再次激活

我希望这对你有帮助,我使用了类似的东西:

sudo systemctl disable dhcpcd.service
sudo systemctl disable netctl.service
sudo reboot

相关内容