问题如下
`# systemctl start firewalld
Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.`
firewall-cmd --reload
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
ImportError: No module named gi.repository
有看到别的老哥说:
其实当输入 firewall-cmd 系列的命令的时候都会报错
原因
因为自己的linux上安装了多个python版本,在启动防火墙时,系统不知道指向了。
解决
修改firewalld文件头版本指向就可以,改成2.7(原先是python)
命令:
vi /usr/sbin/firewalld
vi /usr/bin/firewall-cmd
同样修改头文件指向为2.7版本~
然后重启,本来以为这样就可以了,结果又报错,说是什么找不到bus:
yum install python-gobject -y
yum install python-firewall -y
参考文章:
- https://blog.csdn.net/com_ma/article/details/78040517
- 2021年CentOS7关于Firewalld防火墙失效报错问题处理
- Linux——centos7防火墙重启失败
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/157173.html