![如果在启动时拔下以太网电缆,服务“ifplugd”将无法正常工作](https://linux22.com/image/180542/%E5%A6%82%E6%9E%9C%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E6%8B%94%E4%B8%8B%E4%BB%A5%E5%A4%AA%E7%BD%91%E7%94%B5%E7%BC%86%EF%BC%8C%E6%9C%8D%E5%8A%A1%E2%80%9Cifplugd%E2%80%9D%E5%B0%86%E6%97%A0%E6%B3%95%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C.png)
[Ubuntu内核18.04.4 5.4 arm64]
我使用 USB 网卡(udev
重命名为usb0
)。如果启动时连接 UTP 电缆,则没有问题。在这种情况下,我可以拔掉 UTP,然后重新插入。它工作顺利。
如果在启动时拔掉电缆,则热插拔将无法工作。为了解决这个问题,我安装了ifplugd
,但它工作不稳定。当我检查每个场景中的服务状态时,我得到:
场景 1-ifplugd
服务不适用于usb0
:
# service ifplugd status
● ifplugd.service - LSB: Brings up/down network automatically
Loaded: loaded (/etc/init.d/ifplugd; generated)
Active: active (exited) since Mon 2020-09-21 16:43:02 UTC; 20s ago
Docs: man:systemd-sysv-generator(8)
Process: 893 ExecStart=/etc/init.d/ifplugd start (code=exited, status=0/SUCCESS)
Sep 21 16:43:02 umbrela-bridge systemd[1]: Starting LSB: Brings up/down network automatically...
Sep 21 16:43:03 umbrela-bridge ifplugd[893]: * Network Interface Plugging Daemon...
Sep 21 16:43:03 umbrela-bridge ifplugd[893]: * skip usb0...
Sep 21 16:43:03 umbrela-bridge ifplugd[893]: ...done.
Sep 21 16:43:02 umbrela-bridge systemd[1]: Started LSB: Brings up/down network automatically.
root@umbrela-bridge:/home/umbrela#
场景 2-ifplugd
服务工作于usb0
:
# service ifplugd status
● ifplugd.service - LSB: Brings up/down network automatically
Loaded: loaded (/etc/init.d/ifplugd; generated)
Active: active (running) since Mon 2020-09-21 16:46:26 UTC; 1min 55s ago
Docs: man:systemd-sysv-generator(8)
Process: 884 ExecStart=/etc/init.d/ifplugd start (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 2291)
CGroup: /system.slice/ifplugd.service
└─912 /usr/sbin/ifplugd -i usb0 -q -f -u0 -d10 -w -I
Sep 21 16:46:25 umbrela-bridge systemd[1]: Starting LSB: Brings up/down network automatically...
Sep 21 16:46:26 umbrela-bridge ifplugd[884]: * Network Interface Plugging Daemon...
Sep 21 16:46:26 umbrela-bridge ifplugd[884]: * start usb0...
Sep 21 16:46:26 umbrela-bridge ifplugd(usb0)[912]: ifplugd 0.28 initializing.
Sep 21 16:46:26 umbrela-bridge ifplugd(usb0)[912]: Using interface usb0/00:0E:C6:00:01:01 with driver <ax
Sep 21 16:46:26 umbrela-bridge ifplugd(usb0)[912]: Using detection mode: SIOCETHTOOL
Sep 21 16:46:26 umbrela-bridge ifplugd(usb0)[912]: Initialization complete, link beat not detected.
Sep 21 16:46:26 umbrela-bridge ifplugd[884]: ...done.
Sep 21 16:46:26 umbrela-bridge systemd[1]: Started LSB: Brings up/down network automatically.
lines 1-18/18 (END)
任何帮助表示赞赏。