centos7. 防火墙启动失败Job for firewalld.service failed because the control process exited with error code.

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 Fri 2020-03-06 00:51:01 CST; 4min 40s ago
     Docs: man:firewalld(1)
  Process: 30360 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=1/FAILURE)
 Main PID: 30360 (code=exited, status=1/FAILURE)

Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.
[root@iz2zei0su36x4uwu1tkrr9z ~]# journalctl -xe
-- The start-up result is done.
Mar 06 00:51:01 nameddd CROND[30363]: (root) CMD (/bin/bash /hom
Mar 06 00:51:01 nameddd systemd[1]: Starting Session 2894 of use
-- Subject: Unit session-2894.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-2894.scope has begun starting up.

原因:

firewalld依赖于python,由于之前安装python3的时候,将默认python命令的别名指向了python3,造成无法启动

1、先找到firewalld的位置

    [root@dddd ~]# which firewalld
    /usr/sbin/firewalld

     find -name firewalld 这个不好使用which

2、将/usr/sbin/firewalld文件的第一行修改为旧的python2.7         如果还是不行试试python2、反正大意就是安装python错的。你得改回来。我改python2还是启动失败。centos7.4版本。

     vim /usr/sbin/firewalld

      #!/usr/bin/python2.7 -Es
      # -*- coding: utf-8 -*-

将原来的python改为python2即可。

 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值