莱因电博

Li-e.cn

Li Internet Electronic Blog
@rss

更改 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
(C) 2019 - 2024 Li-e.cn莱因电博(立网电子博客) | Powered by Vercel , based on Hugo with Gists theme.