更改 Ubuntu 开机时网络服务等待时间
Change the network service waiting time when Ubuntu starts up
————————————————————
修改Ubuntu开、关机的网络检查时间
cd /etc/systemd/system/network-online.target.wants/
sudo vim systemd-networkd-wait-online.service
在 [Service] 最下方添加:TimeoutStartSec=5sec
(等待5秒)
最后的文件应该像这样:
[Unit]
Description=Wait for Network to be Configured
Documentation=man:systemd-networkd-wait-online.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
Requires=systemd-networkd.service
After=systemd-networkd.service
Before=network-online.target shutdown.target
[Service]
Type=oneshot
ExecStart=/lib/systemd/systemd-networkd-wait-online
RemainAfterExit=yes
TimeoutStartSec=5sec
[Install]
WantedBy=network-online.target