解决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
相关推荐
天才奇男子3 小时前
《深度解析HAProxy七层代理:原理、配置与最佳实践》
linux·运维·微服务·云原生
交换机路由器测试之路3 小时前
交换机专题:什么是ALS(激光器自动关断)
运维·网络·以太网·交换机·节能
学嵌入式的小杨同学3 小时前
【Linux 封神之路】文件操作 + 时间编程实战:从缓冲区到时间格式化全解析
linux·c语言·开发语言·前端·数据库·算法·ux
wifi chicken3 小时前
Linux wlan 之sniffer log 解密详解
linux·wlan·sniffer log·空口包·空口解密
济6173 小时前
ARM Linux 驱动开发篇----字符设备驱动开发(1)--字符设备驱动简介---- Ubuntu20.04
linux·嵌入式硬件
浪客灿心3 小时前
Linux的Ext系列文件系统
linux·运维·服务器·c语言
速易达网络3 小时前
linux命令大全
linux·运维·excel
·云扬·3 小时前
Redis运维实战:大key与热key排查优化、监控指标及内存策略全解析
运维·数据库·redis
落笔映浮华丶3 小时前
linux项目自动构建工具 -make/makefile
linux·运维·服务器
爱装代码的小瓶子3 小时前
【C++与Linux基础】文件篇(3)-fd的本质和minishell的重定向功能
linux·c++