linux关闭防火墙命令后,输入“systemctl status firewalld.service”命令,为什么我显示的是failed?


Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since 三 2021-12-08 09:59:47 CST; 1 weeks 5 days ago
     Docs: man:firewalld(1)
  Process: 694 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=203/EXEC)
 Main PID: 694 (code=exited, status=203/EXEC)

1208 09:59:47 localhost.localdomain systemd[1]: Starting firewalld - dyna...
1208 09:59:47 localhost.localdomain systemd[694]: Failed at step EXEC spa...
1208 09:59:47 localhost.localdomain systemd[1]: firewalld.service: main p...
1208 09:59:47 localhost.localdomain systemd[1]: Failed to start firewalld...
1208 09:59:47 localhost.localdomain systemd[1]: Unit firewalld.service en...
1208 09:59:47 localhost.localdomain systemd[1]: firewalld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

能否帮忙解读一下?万分感谢!

是否最近安装了python3并修改了环境变量?
这个问题可能是因为firewalld是由python2.7开发的,而我们的系统装了其他版本的python并且修改了默认python的路径为/usr/bin/python,
只需要将/usr/sbin/firewalld 文件的第一行改为/usr/bin/python2.7就可以解决问题。

添加 -l 参数,看完整日志