【问题标题】:Failed to start firewalld on centos 7在 centos 7 上启动 firewalld 失败
【发布时间】:2023-04-04 12:04:01
【问题描述】:

我在我的 centos 服务器上安装了 firewalld,但是当我尝试启动它时,我得到了这个:

$ sudo systemctl start firewalld
Job for firewalld.service failed. See 'systemctl status firewalld.service' and 'journalctl -xn' for details.

这里是 systemctl 状态:

sudo systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: failed (Result: exit-code) since پنجشنبه 2016-04-07 05:36:17 UTC; 9s ago
  Process: 929 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=1/FAILURE)
 Main PID: 929 (code=exited, status=1/FAILURE)

آوریل 07 05:36:17 server1.hamed1soleimani.ir systemd[1]: firewalld.service: main process exited, code=exited, status=1/FAILURE
آوریل 07 05:36:17 server1.hamed1soleimani.ir systemd[1]: Failed to start firewalld - dynamic firewall daemon.
آوریل 07 05:36:17 server1.hamed1soleimani.ir systemd[1]: Unit firewalld.service entered failed state.

和firewall-cmd状态:

sudo firewall-cmd --stat
Traceback (most recent call last):
  File "/bin/firewall-cmd", line 24, in <module>
    from gi.repository import GObject
  File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 37, in <module>
    from . import _gi
ImportError: /usr/lib64/python2.7/site-packages/gi/_gi.so: undefined symbol: g_type_check_instance_is_fundamentally_a

我无法理解firewalld和一些gtk python扩展之间的关系!

【问题讨论】:

  • GTK+ 建立在一个名为 GLib 的库之上,该库提供各种实用程序(如操作系统抽象和高级数据结构)、一个 I/O 抽象层,对 GTK+ 最重要的是GTK+ 使用的面向对象系统和允许 Python 使用它的 gi(GObject Introspection)包。 firewalld 也在使用 GLib;不过,它不使用 GTK+。至于你的错误,我猜你的 GLib 版本太旧了(或者你的 python-gobject 版本太旧了?两者都有?)。
  • 还要注意不要将 GLib 与 glibc(大多数 Linux 发行版使用的 libc)混淆。
  • @andlabs 非常感谢!更新库后问题解决。
  • 什么是库?如何升级库?

标签: python linux centos gtk firewall


【解决方案1】:

我知道这是一个旧线程,但我遇到了这个问题,我刚刚修复了它,认为它会在不久的将来帮助某人。

我认为问题出在我的代码中,或者我放错了文件。

好吧,遗憾的是这个文件已损坏(可能放错了位置)

/usr/lib/python2.7/site-packages/gi/_gi.so 或者我认为它编译得很糟糕。

你需要更新 Glib 2,因为它会覆盖并修复它,你可以使用 yum

试试yum update glib2

我使用 CentOS Linux 版本 7.1.1503 (Core)

测试了上述内容

干杯

【讨论】:

  • 谢谢老兄!你真的帮了我大忙!
【解决方案2】:

这对我有用:

systemctl stop firewalld
pkill -f firewalld
systemctl start firewalld

【讨论】:

    【解决方案3】:

    问题是你的包裹/usr/lib/python2.7/site-packages/gi/_gi.so

    Debian (python2) -> sudo apt install python-gi
    Debian (python3) -> sudo apt install python3-gi
    

    基于 RedHat 的系统 -> yum install gilb2

    注意:对于覆盖和修复,您可以使用: -> yum update glib2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-22
      • 1970-01-01
      • 2021-04-13
      • 1970-01-01
      • 2015-12-18
      • 1970-01-01
      • 1970-01-01
      • 2014-07-02
      相关资源
      最近更新 更多