如果在启动时拔下以太网电缆,服务“ifplugd”将无法正常工作

如果在启动时拔下以太网电缆,服务“ifplugd”将无法正常工作

[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)

任何帮助表示赞赏。

相关内容