解决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
相关推荐
tiger从容淡定是人生1 分钟前
金融系统 Summit Backend 的 Docker 化实践:CI/CD、测试与安全性的工程经验总结
运维·docker·云原生·容器·eureka·金融
小白考证进阶中9 分钟前
阿里云ACA部分考试成绩分享(2月/3月/4月)
运维·阿里云·云计算·阿里云认证·阿里云aca认证·阿里云aca·阿里云aca大数据认证
杰 .11 分钟前
Linux 开机 + 进程创建 + fork + exec + 加载器
linux·服务器
bingyan037111 分钟前
mysql-使用openclaw自动化安装xenon集群
运维·mysql·自动化·集群·openclaw·xenon
无忧智库14 分钟前
新能源场站无人值守革命:构建高效、安全、智能的下一代运维体系(PPT)
运维·安全
blackorbird17 分钟前
AI工作流自动化平台n8n正被大规模网络武器化
运维·网络·人工智能·自动化
Fcy64817 分钟前
Linux下 进程控制(二) —— 进程程序替换
linux·运维·服务器
浮尘笔记18 分钟前
Java Snowy 框架生产环境安全部署全流程(服务器篇)
java·运维·服务器·开发语言·后端
web守墓人18 分钟前
【linux】Mubuntu v1.0.10更新日志
linux·运维·服务器
不怕犯错,就怕不做22 分钟前
(Hisilicon)笔试题:嵌入式Linux C语言GPIO中断与按键消抖(转载)
linux·驱动开发·嵌入式硬件