解决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
相关推荐
烦躁的大鼻嘎35 分钟前
【Linux】ELF与动静态库的“暗黑兵法”:程序是如何跑起来的?
linux·运维·服务器·c++·vscode·ubuntu
API_technology1 小时前
阿里巴巴 1688 数据接口开发指南:构建自动化商品详情采集系统
大数据·运维·数据挖掘·自动化
qq21084629531 小时前
【Linux驱动】Linux 按键驱动开发指南
linux·驱动开发
L_cl1 小时前
【NLP 75、如何通过API调用智谱大模型】
linux·服务器·windows
努力学习的小廉1 小时前
深入了解linux系统—— 基础IO(下)
linux·运维·服务器
斯文by累2 小时前
解锁DeepSeek潜能:Docker+Ollama打造本地大模型部署新范式
运维·docker·容器
Lzc7742 小时前
Linux的进程概念
linux·linux的进程概念
weniry2 小时前
Git基础原理和使用
linux
小雅痞3 小时前
[Java][Leetcode middle] 12. 整数转罗马数字
java·linux·leetcode
不许哈哈哈3 小时前
自动化点击工具
运维·python·自动化