解决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
相关推荐
热爱嵌入式的小许16 分钟前
Linux基础项目开发1:量产工具——显示系统
linux·运维·服务器·韦东山量产工具
韩楚风4 小时前
【linux 多进程并发】linux进程状态与生命周期各阶段转换,进程状态查看分析,助力高性能优化
linux·服务器·性能优化·架构·gnu
陈苏同学4 小时前
4. 将pycharm本地项目同步到(Linux)服务器上——深度学习·科研实践·从0到1
linux·服务器·ide·人工智能·python·深度学习·pycharm
Ambition_LAO4 小时前
解决:进入 WSL(Windows Subsystem for Linux)以及将 PyCharm 2024 连接到 WSL
linux·pycharm
Pythonliu74 小时前
茴香豆 + Qwen-7B-Chat-Int8
linux·运维·服务器
你疯了抱抱我4 小时前
【RockyLinux 9.4】安装 NVIDIA 驱动,改变分辨率,避坑版本。(CentOS 系列也能用)
linux·运维·centos
追风赶月、5 小时前
【Linux】进程地址空间(初步了解)
linux
栎栎学编程5 小时前
Linux中环境变量
linux
挥剑决浮云 -5 小时前
Linux 之 安装软件、GCC编译器、Linux 操作系统基础
linux·服务器·c语言·c++·经验分享·笔记
小O_好好学6 小时前
CentOS 7文件系统
linux·运维·centos