在不存在的 eth0 接口上停止 dhclient

在不存在的 eth0 接口上停止 dhclient

我的 Ubuntu 18.04.3 系统需要额外 90 秒才能启动,因为它试图在不存在的接口“eth0”上运行 dhclient。与此同时,DHCP 已经在正确的接口“ext0”上运行并在 1 秒内成功。

Jan 29 13:46:38 server systemd[1]: sys-subsystem-net-devices-eth0.device: Job sys-subsystem-net-devices-eth0.device/start timed out.
Jan 29 13:46:38 server systemd[1]: Timed out waiting for device sys-subsystem-net-devices-eth0.device.
Jan 29 13:46:38 server systemd[1]: Dependency failed for dhclient on eth0.

没有 eth0,因为我在 udev 中重命名了所有 PCI 网络接口。重命名的原因是为了拥有持久的名称,它们不能是 eth0,因为 udev 不再正确地执行此操作(eth0“文件存在”),这一点已讨论这里

# PCI device 0x1969:0xe0a1 pci@0000:04:00.0 (Qualcomm/Atheros Killer E2400 GigE Controller)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:9e:f3:82:e8:ed", NAME="ext0"

# PCI device 0x10ec:0x8168 pci@0000:71:00.0 (RTL8111/8168/8411 PCIE GigE Controller)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:15:9e:56", NAME="int0"

# PCI device 0x168c:0x0042 pci@0000:03:00.0 (Qualcomm/Atheros QCA9377 802.11ac Wireless Network Adapter)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="5c:ea:1d:8a:db:35", NAME="wlan0"

systemctl 显示这些设备的正确条目,但我找不到与 eth0 相关的任何 systemd 单元文件。它从哪里获取该文件?我该如何禁用它?

答案1

终于解决了。systemd 依赖项是multi-user.service-> [email protected]-> sys-subsystem-net-devices-eth0.device。我必须:

mv /etc/systemd/system/[email protected] /lib/systemd/system/
sudo systemctl disable [email protected]

这删除了​​。现在系统启动速度快多了。我正在使用运行 DHCP 的方法,不确定 systemd 依赖项是如何到达那里的。我移动的文件不在任何 Ubuntu 软件包中。/etc/systemd/system/multi-user.target.wants/[email protected]/etc/network/interfaces

相关内容