[Centos7.2]关于升级python后防火墙无法启动

时间:2022-07-22
本文章向大家介绍[Centos7.2]关于升级python后防火墙无法启动,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

本文编写于 205 天前,最后修改于 205 天前,其中某些信息可能已经过时。

Centos7.2默认安装的python版本为python2.7,因为我使用的python版本是3.x版,便将其升级到了python3.6,但是升级完成后发现防火墙一直无法成功启动,查看报错为:

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

解决方法分成两个步骤: 1.编辑firewall-cmd配置文件

vi /usr/bin/firewall-cmd
将!/usr/bin/python -Es修改为#!/usr/bin/python2.7 -Es

2.编辑firewalld配置文件

 vi /usr/sbin/firewalld
将!/usr/bin/python -Es修改为#!/usr/bin/python2.7 -Es

3.再重新启动防火墙

systemctl restart firewalld.service