解决ubuntu启动卡住报错:a start job is running for wait

一台测试用的服务器,每次启动都要卡在一个地方好几分钟,因为不常用,也就没管它。

近两天使用它测试,每次开机太浪费时间了,就去找原因和解决的方法。

首先将报错找出来,对照着敲到百度:a start job is running for wait,果然搜索到解决方法。

解决的方法是修改/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service 文件,在里面加上一句 TimeoutStartSec=5sec

复制代码
xx@ub:/etc/systemd/system/network-online.target.wants$ cat systemd-networkd-wait-online.service
#  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)
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
相关推荐
浅念-2 小时前
Linux 开发环境与工具链
linux·运维·服务器·数据结构·c++·经验分享
似水এ᭄往昔4 小时前
【Linux】gdb的使用
linux·运维·服务器
优雅的造轮狮4 小时前
WSL2 Docker Desktop配置优化及迁移D盘指南
运维·docker·容器
tian_jiangnan4 小时前
grafana白皮书
linux·服务器·grafana
枫桥骤雨4 小时前
我的龙虾日记
ubuntu·openclaw
大师影视解说4 小时前
基于Web端的AI电影解说自动化生产工具实测:4步完成从文案到成片的全流程
运维·人工智能·自动化·影视解说·电影解说工具·网页版电影解说·ai电影解说
mizuhokaga5 小时前
Linux内网集群基于Docker 安装 Chat2DB
linux·运维·docker
科士威传动5 小时前
微型导轨从精密制造到智能集成的跨越
大数据·运维·科技·机器人·自动化·制造
biubiubiu07065 小时前
Vibe Coding
运维
Ricky_Theseus5 小时前
数据库关系代数 - 连接操作
linux·数据库·算法