重启网络出现报错
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
今天更改完静态ip后发现network服务重启不了,翻遍了网络,尝试了各种方法,终于解决了。
1.执行systemctl restart network.service命令后出现下面的错误
[root@web01 ~]# 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.
2.按照报错提示输入了systemctl status network.service
[root@web01 ~]# 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 日 2022-11-13 11:36:56 CST; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 1298 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
Process: 1457 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
11月 13 11:36:56 web01 network[1457]: [ 确定 ]
11月 13 11:36:56 web01 network[1457]: 正在打开接口 eth1: 连接已成功激活(D-Bus 活动路径:/org/freed…on/4)
11月 13 11:36:56 web01 network[1457]: [ 确定 ]
11月 13 11:36:56 web01 network[1457]: 正在打开接口 eth2: ERROR : [/etc/sysconfig/network-script…esent.
11月 13 11:36:56 web01 /etc/sysconfig/network-scripts/ifup-eth[1647]: Device name does not seem to be p....
11月 13 11:36:56 web01 network[1457]: [失败]
11月 13 11:36:56 web01 systemd[1]: network.service: control process exited, code=exited status=1
11月 13 11:36:56 web01 systemd[1]: Failed to start LSB: Bring up/down networking.
11月 13 11:36:56 web01 systemd[1]: Unit network.service entered failed state.
11月 13 11:36:56 web01 systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
3.解决方法
3.1网络配置工具network和NetworkManager冲突导致的,NetworkManager一般用于安装了桌面环境的Linux系统,一般情况下我们直接使用以下明令禁止使用NetworkManager就行了
[root@web01 ~]# systemctl stop NetworkManager
[root@web01 ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
[root@web01 ~]# systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disable; vendor preset: enabled)
Active: inactive (dead) since 日 2022-11-13 11:50:58 CST; 5s ago
Docs: man:NetworkManager(8)
Process: 667 ExecStart=/usr/sbin/NetworkManager --no-daemon (code=exited, status=0/SUCCESS)
Main PID: 667 (code=exited, status=0/SUCCESS)
11月 13 11:36:56 web01 NetworkManager[667]: <info> [1668310616.7621] device (eth1): state change: i...ed')
11月 13 11:36:56 web01 NetworkManager[667]: <info> [1668310616.7630] device (eth1): state change: s...ed')
11月 13 11:36:56 web01 NetworkManager[667]: <info> [1668310616.7654] device (eth1): Activation: suc...ted.
11月 13 11:36:56 web01 NetworkManager[667]: <warn> [1668310616.7795] ifcfg-rh: loading "/etc/syscon...eys.
11月 13 11:36:56 web01 NetworkManager[667]: <warn> [1668310616.7912] ifcfg-rh: loading "/etc/syscon...eys.
11月 13 11:50:58 web01 NetworkManager[667]: <info> [1668311458.4319] caught SIGTERM, shutting down ...lly.
11月 13 11:50:58 web01 systemd[1]: Stopping Network Manager...
11月 13 11:50:58 web01 NetworkManager[667]: <info> [1668311458.4325] manager: NetworkManager state ...SITE
11月 13 11:50:58 web01 NetworkManager[667]: <info> [1668311458.4343] exiting (success)
11月 13 11:50:58 web01 systemd[1]: Stopped Network Manager.
Hint: Some lines were ellipsized, use -l to show in full.
关闭之后重启发现不能解决,问题不大继续尝试其他方法
3.2看VMWare右下角的网络适配器
是否连接,如果没有连接则连接上。
3.3如果你改成了静态ip别忘了将BOOTPROTO
改为static
3.4最后发现是/etc/syscofig/network-scripts/下多了一个ifcfg-eth2的文件,把多余的文件删除或者移动即可
文章来源:https://www.toymoban.com/news/detail-507828.html
[root@web01 ~]# rm -f /etc/sysconfig/network-scripts/ifcfg-eth2
[root@web01 ~]# systemctl restart network.service
[root@web01 ~]#
重启成功文章来源地址https://www.toymoban.com/news/detail-507828.html
到了这里,关于关于Job for network.service failed because the control process exited with error code.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!