linux 7 network fail,CentOS7 network.service loaded failed 处理技巧

某一日,用systemctl--failed查看到如下错误信息,但实际上网络是OK的,真奇怪:[root@localhost.localdomainmedia]#systemctl--failedUNIT&..

某一日,用systemctl --failed查看到如下错误信息,但实际上网络是OK的,,真奇怪:[root@localhost.localdomain media]# systemctl --failed

UNIT            LOAD   ACTIVE SUB    DESCRIPTION

network.service loaded failed failed LSB: Bring up/down networking

LOAD   = Reflects whether the unit definition was properly loaded.

ACTIVE = The high-level unit activation state, i.e. generalization of SUB.

SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.

To show all installed unit files use 'systemctl list-unit-files'.

执行此命令来解决这个问题:[root@F1A-SWPE ~]#  systemctl enable NetworkManager-wait-online.service

重启后再次用systemctl --failed查看,问题消失:[root@localhost.localdomain ~]# systemctl --failed

0 loaded units listed. Pass --all to see loaded but inactive units, too.

To show all installed unit files use 'systemctl list-unit-files'.

解决问题的关键跟/usr/lib/systemd/system/NetworkManager-wait-online.service这个文档有关,其内容如下:

[Unit]

Description=Network Manager Wait Online

Requisite=NetworkManager.service

After=NetworkManager.service

Wants=network.target

Before=network.target network-online.target

[Service]

Type=oneshot

ExecStart=/usr/bin/nm-online -q --timeout=30

[Install]

WantedBy=multi-user.target

有兴趣的同学不妨研究一下这个文档就能明了!!

End.

本文出自 “冯学伟-遇见曾经的妳” 博客,请务必保留此出处

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值