安装完python3版本后,防火墙无法启动Job for firewalld.service failed because the control process exited with error

# firewall-cmd --state
发现
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
ModuleNotFoundError: No module named ‘gi‘
看到这个地址,去查看一下
# vim /usr/bin/firewall-cmd

在第一行后面添加之前使用的python版本

继续

# firewall-cmd --state

发现

not running

启动防火墙 service firewalld start

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

● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since 日 2018-04-15 22:16:26 CST; 19s ago
     Docs: man:firewalld(1)
  Process: 8920 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=1/FAILURE)
 Main PID: 8920 (code=exited, status=1/FAILURE)

4月 15 22:16:26 python-0-121 systemd[1]: Starting firewalld - dynamic firewall da.....
4月 15 22:16:26 python-0-121 systemd[1]: firewalld.service: main process exited, ...RE
4月 15 22:16:26 python-0-121 systemd[1]: Failed to start firewalld - dynamic fire...n.
4月 15 22:16:26 python-0-121 systemd[1]: Unit firewalld.service entered failed state.
4月 15 22:16:26 python-0-121 systemd[1]: firewalld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
先看高亮部分,发现红色高亮部分有一个地址,进去看看
vim /usr/sbin/firewalld

又看到解释器版本是/usr/bin/python 改成自己之前使用的版本

oh yes,问题解决了,试一下

service firewalld start 。 OK




阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页