




























Job systemd-networkd-wait-online.service/start running
该问题通常出现在 Ubuntu Server 或无图形界面的 Linux 系统 中,表现为开机卡在 “A start job is running for Wait for Network to be configured” 提示,持续约 30 秒至 2 分钟,之后系统会继续启动。这是由于 systemd-networkd-wait-online.service 服务默认等待所有网络接口配置完成并进入“可路由”状态,若网卡未连接网线、DHCP 响应慢或 WiFi 未连接,就会超时等待。
systemd-networkd 管理网络(常见于 Ubuntu Server 18.04+)。解决办法
cd /etc/systemd/system/network-online.target.wants/
sudo vim systemd-networkd-wait-online.service
#在Service加入TImeoutStartSec=2sec

# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Wait for Network to be Configured
Documentation=man:systemd-networkd-wait-online.service(8)
ConditionCapability=CAP_NET_ADMIN
DefaultDependencies=no
Conflicts=shutdown.target
BindsTo=systemd-networkd.service
After=systemd-networkd.service
Before=network-online.target shutdown.target
[Service]
Type=oneshot
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online
RemainAfterExit=yes
TImeoutStartSec=2sec
[Install]
WantedBy=network-online.target
:wq 保存退出
shutdown - r now 重新启动即可
原文链接:
https://blog.csdn.net/beck_li/article/details/144189133
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。