解决 Debian 开机中 networking 大量耗时的问题

joseph · 2021-05-26 14:58:20 · 1006 次点击 · 大约8小时之前 开始浏览    置顶
这是一个创建于 2021-05-26 14:58:20 的主题,其中的信息可能已经有所发展或是发生改变。

首先查看哪些服务占用了开机时间:

systemd-analyze blame

本文示例中发现 networking.service 的时间长达 5 分钟。查看该服务状态可发现如下错误:

systemd[1]: networking.service: Start operation timed out. Terminating.
systemd[1]: networking.service: Main process exited, code=killed, status=15/TERM
systemd[1]: networking.service: Failed with result 'timeout'.
systemd[1]: Failed to start Raise network interfaces.

解决方案

编辑文件: sudo vim /etc/network/interfaces

将原来的:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

改为:

auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp

重启查验结果。

关注本站微信公众号(和以上内容无关)InfraPub ,扫码关注:InfraPub

1006 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传