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即可。