解决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
相关推荐
h***01542 小时前
Docker启动安装nacos(详情讲解,全网最细)
运维·docker·容器
z***94842 小时前
Linux下安装Nginx服务及systemctl方式管理nginx详情
linux·运维·nginx
默恋~微凉2 小时前
Nginx(十一)——反向代理与负载均衡
运维·nginx·负载均衡
凉晓风3 小时前
Linux上TCP通信异常排查工具命令
linux·运维·tcp/ip
Xの哲學3 小时前
Linux 分区表深度技术剖析
linux·网络·算法·架构·边缘计算
q***18843 小时前
Ubuntu上安装、使用Redis的详细教程
redis·ubuntu·bootstrap
码龄3年 审核中3 小时前
Linux record 03
java·linux·运维
星驰云3 小时前
记一次CentOS 硬盘损坏无法启动修复教程
linux·运维·centos
人工智能训练3 小时前
windows系统中的docker,xinference直接运行在容器目录和持载在宿主机目录中的区别
linux·服务器·人工智能·windows·ubuntu·docker·容器
q***47434 小时前
Windows 和 Linux 系统下,如何查看 Redis 的版本号?
linux·windows·redis