linux 服务重启失败,Linux 重启network 失败的解决办法

执行 systemctl restart network 失败

[root@ceph0 ~]# systemctl restart network

Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

[root@ceph0 ~]# systemctl status network

● network.service - LSB: Bring up/down networking

Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)

Active: failed (Result: exit-code) since 二 2019-03-26 12:02:46 CST; 8s ago

Docs: man:systemd-sysv-generator(8)

Process: 3185106 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

3月 26 12:02:46 ceph0 network[3185106]: RTNETLINK answers: File exists

3月 26 12:02:46 ceph0 network[3185106]: RTNETLINK answers: File exists

3月 26 12:02:46 ceph0 network[3185106]: RTNETLINK answers: File exists

3月 26 12:02:46 ceph0 network[3185106]: RTNETLINK answers: File exists

3月 26 12:02:46 ceph0 network[3185106]: RTNETLINK answers: File exists

3月 26 12:02:46 ceph0 network[3185106]: RTNETLINK answers: File exists

3月 26 12:02:46 ceph0 systemd[1]: network.service: control process exited, code=exited status=1

3月 26 12:02:46 ceph0 systemd[1]: Failed to start LSB: Bring up/down networking.

3月 26 12:02:46 ceph0 systemd[1]: Unit network.service entered failed state.

3月 26 12:02:46 ceph0 systemd[1]: network.service failed.

看红色部门 Failed to start LSB: Bring up/down networking. 但是实际上这个信息并没有什么卵用

8f6c268f1c53f5da0717bae074303d47.png

要是你拿着这个信息不假思索的去网上搜一圈,我相信你有可能失望而归。CSDN 等博客都是你抄我,我抄你,从来都不验证下的,就是复制粘贴。

排查思路

遇到这种问题,最好的办法就是看日志输出了啥咯,执行 tail -f /var/log/messages|grep network

[root@ceph0 ~]# tail -f /var/log/messages|grep network

Mar 26 12:05:06 ceph0 systemd: Starting LSB: Bring up/down networking...

Mar 26 12:05:06 ceph0 network: Bringing up loopback interface: [ OK ]

Mar 26 12:05:06 ceph0 network: Bringing up interface eth0: [ OK ]

Mar 26 12:05:06 ceph0 network: Bringing up interface eth1: Error: Connection activation failed: No suitable device found for this connection.

Mar 26 12:05:06 ceph0 network: [FAILED]

Mar 26 12:05:06 ceph0 network: Bringing up interface eth2: Error: Connection activation failed: No suitable device found for this connection.

Mar 26 12:05:06 ceph0 network: [FAILED]

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 network: RTNETLINK answers: File exists

Mar 26 12:05:06 ceph0 systemd: network.service: control process exited, code=exited status=1

Mar 26 12:05:06 ceph0 systemd: Failed to start LSB: Bring up/down networking.

Mar 26 12:05:06 ceph0 systemd: Unit network.service entered failed state.

Mar 26 12:05:06 ceph0 systemd: network.service failed.

可以看到报错

Mar 26 12:05:06 ceph0 network: Bringing up interface eth1: Error: Connection activation failed: No suitable device found for this connection.

Mar 26 12:05:06 ceph0 network: [FAILED]

Mar 26 12:05:06 ceph0 network: Bringing up interface eth2: Error: Connection activation failed: No suitable device found for this connection.

很明显,没有eth1 和eth2 接口 导致报错,进入 /etc/sysconfig/network-scripts/

[root@ceph0 ~]# cd /etc/sysconfig/network-scripts/

[root@ceph0 network-scripts]# ls

ifcfg-eth0 ifdown-eth ifdown-post ifdown-tunnel ifup-ippp ifup-post ifup-tunnel

ifcfg-eth1 ifdown-ib ifdown-ppp ifup ifup-ipv6 ifup-ppp ifup-wireless

ifcfg-eth2 ifdown-ippp ifdown-routes ifup-aliases ifup-isdn ifup-routes init.ipv6-global

ifcfg-lo ifdown-ipv6 ifdown-sit ifup-bnep ifup-ovs ifup-sit network-functions

ifdown ifdown-isdn ifdown-Team ifup-eth ifup-plip ifup-Team network-functions-ipv6

ifdown-bnep ifdown-ovs ifdown-TeamPort ifup-ib ifup-plusb ifup-TeamPort

[root@ceph0 network-scripts]#

删除eth1 和eth2 配置文件,重启网卡即可

root@ceph0 network-scripts]# rm -rf ifcfg-eth1 ifcfg-eth2

[root@ceph0 network-scripts]# systemctl restart network

[root@ceph0 network-scripts]#

6ad3dd87ede1e54bf6059c80e9f2384a.png

  • 6
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值