解决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
相关推荐
ADAI_Bowen13 小时前
写文章 - 知乎
大数据·运维·人工智能
GeW13 小时前
新质生产力路线图解读:数据库性能优化与Linux调优专场
linux
云宏信息14 小时前
超融合和存算分离怎么选?从性能、可靠性、扩展、成本四个维度讲述如何精准匹配架构选型 | 附企业降本轻量云方案
运维·服务器·架构·云计算
mounter62514 小时前
深入理解 gccrs:GCC 如何实现 Rust 编译器,以及编译 Linux 内核面临的挑战
linux·驱动开发·rust
垚垚学技术_聚焦云原生14 小时前
Ansible Playbook 进阶:when 条件、loop 循环、handlers 触发器落地
linux·ansible·自动化运维·devops
无足鸟ICT15 小时前
【RHCA+】type命令(判断命令类型)
linux·ssh·bash
咸鱼梦想家π15 小时前
Linux开发工具(下)
linux·运维·服务器
LHICOD15 小时前
Linux-1
linux·ip·vmware·虚拟机·cmd·ping
云飞云共享云桌面16 小时前
机械制造研发部门:一台SolidWorks云主机替代 10 台传统图形工作站
运维·服务器·网络·3d·自动化·制造
j7~16 小时前
【ProtoBuf】(篇一)初识 ProtoBuf
运维·服务器·序列化·protobuf·protobuf的适用特点