PVE新建的debian11开机6分钟左右,这肯定不正常了,赶紧查看哪里拖慢开机速度

systemd-analyze blame

经过检查发现是networking.service的锅

vi /lib/systemd/system/networking.service

那就把networking.service的超时时间修改短点

root@nezha:~# cat /lib/systemd/system/networking.service
[Unit]
Description=Raise network interfaces
Documentation=man:interfaces(5)
DefaultDependencies=no
Requires=ifupdown-pre.service
Wants=network.target
After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service ifupdown-pre.service
Before=network.target shutdown.target network-online.target
Conflicts=shutdown.target

[Install]
WantedBy=multi-user.target
WantedBy=network-online.target

[Service]
Type=oneshot
EnvironmentFile=-/etc/default/networking
ExecStart=/sbin/ifup -a --read-environment
ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
RemainAfterExit=true
TimeoutStartSec=5s  //修改到5s

重启果然快多了

最后修改:2024 年 01 月 02 日
如果觉得我的文章对你有用,请随意赞赏