Linux无法重启network服务

问题描述:

systemctl restart network的时候报错

[root@localhost network-scripts]# 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@localhost network-scripts]# 

systemctl status network.service执行报错提示语句,得到结果

[root@localhost network-scripts]# systemctl status network.service
● 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 六 2020-02-29 17:20:12 CST; 1min 37s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 31043 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

2月 29 17:20:12 localhost.localdomain network[31043]: RTNETLINK answers: File exists
2月 29 17:20:12 localhost.localdomain network[31043]: RTNETLINK answers: File exists
2月 29 17:20:12 localhost.localdomain network[31043]: RTNETLINK answers: File exists
2月 29 17:20:12 localhost.localdomain network[31043]: RTNETLINK answers: File exists
2月 29 17:20:12 localhost.localdomain network[31043]: RTNETLINK answers: File exists
2月 29 17:20:12 localhost.localdomain network[31043]: RTNETLINK answers: File exists
2月 29 17:20:12 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1
2月 29 17:20:12 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking.
2月 29 17:20:12 localhost.localdomain systemd[1]: Unit network.service entered failed state.
2月 29 17:20:12 localhost.localdomain systemd[1]: network.service failed.
[root@localhost network-scripts]# 

journalctl -xe执行第二条语句是/var/log/message的一些日志信息

信息不全,通过Linux的日志文件去查看完整的错误日志
tail -10000 /var/log/messages |grep network
发现是网卡配置了bond口,可能是配置了bond口,bond配置文件却被删除的问题

[root@localhost network-scripts]# tail -10000 /var/log/messages |grep network

...
Bringing up interface enp1s0:  Error: Connection activation failed: Can not find a master for System eno2: Master connection not found or invalid
...

ifconfig -a查看时果然没有bond口

cat ifcfg-enp1s0文件查看配置

[root@localhost network-scripts]# cat ifcfg-enp1s0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
DEVICE=enp1s0
[root@localhost network-scripts]# 

发现是配置中是有bond的,所以出现配置错误的情况

修改配置文件,祛除MASTER和SLAVE配置

systemctl restart network重启网卡发现无错误通过,问题解决

你可能感兴趣的:(Linux无法重启network服务)