解决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
相关推荐
地衣君29 分钟前
Ubuntu 配置使用 zsh + 插件配置 + oh-my-zsh 美化过程
linux·运维·ubuntu
2401_8582861131 分钟前
OS11.【Linux】vim文本编辑器
linux·运维·服务器·编辑器·vim
朱包林40 分钟前
day27-shell编程(自动化)
linux·运维·服务器·网络·shell脚本
钢铁男儿40 分钟前
一文掌握 Tombola 抽象基类的自动化子类测试策略
运维·自动化
kaede1 小时前
Linux实现线程同步的方式有哪些?
linux·运维·云计算
德先生&赛先生1 小时前
Linux编程:2、进程基础知识
linux
子正1 小时前
一键编译包含多个独立模块和应用的工程(linux cmake)
linux·运维·cmake
小阳睡不醒1 小时前
小白成长之路-Linux Shell脚本练习
linux·运维·服务器
dessler2 小时前
代理服务器-LVS的DR模式
linux·运维·云计算
梦星辰.3 小时前
VSCode CUDA C++进行Linux远程开发
linux·c++·vscode