zoukankan      html  css  js  c++  java
  • CentOS7 network.service loaded failed 处理技巧

    某一日,用systemctl --failed查看到如下错误信息,但实际上网络是OK的,真奇怪:

    1
    2
    3
    4
    5
    6
    7
    8
    [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' .

     执行此命令来解决这个问题:

    1
    [root@F1A-SWPE ~] #  systemctl enable NetworkManager-wait-online.service

    重启后再次用systemctl --failed查看,问题消失:

    1
    2
    3
    [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

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

    最后sudo service network restart    解决

  • 相关阅读:
    【STL源码剖析读书笔记】【第6章】算法之inplace_merge算法
    Python学习 过程中零散知识点的总结
    Python 从零学起(纯基础) 笔记 (二)
    Python 从零学起(纯基础) 笔记(一)
    用select实现监控终端输入
    实现socket非阻塞设置
    exit(0)、exit(1)、exit(-1)的区别
    解决bind错误 bind: Address already in use
    UDP编程中client和server中使用recvfrom和sendto的区别
    linux安装zookeeper
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15454488.html
Copyright © 2011-2022 走看看