CentOS 7重启获取权限出错?

CentOS 7重启获取权限出错?

我尝试在 后重新启动 CentOS 7 yum update,但在运行时出现以下错误sudo reboot

获取权限时出错:初始化权限时出错:GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: SELinux 策略阻止此发件人将此消息发送给此收件人,0 个匹配规则; type=“method_call”,sender=“(null)”(非活动)interface=“org.freedesktop.DBus”成员=“Hello”错误名称=“(未设置)”requested_reply=“0”destination=“org.freedesktop. DBus”(总线)(g-dbus-error-quark,9)

当我运行时我也遇到同样的错误sudo service dbus start

有人可以帮忙吗?

答案1

这个问题与 SELinux 有关。

SELinux 策略阻止此发件人将此消息发送给此收件人,0 个匹配规则; type =“method_call”,sender =“(null)”(非活动)interface =“org.freedesktop.DBus”member =“Hello”错误名称=“(未设置)”

您可以尝试解决此问题或禁用 SELinux。一般建议不是禁用试图使您的系统更安全的软件,但如果它是桌面或不是生产类型的系统,这些是更容易被接受的方法。

要禁用 SELinux 并将其置于permissive模式:

$ getenforce
Enforcing

$ setenforce 0
setenforce: SELinux is disabled

要使其永久化,您可以编辑此文件,/etc/selinux/config并更改行SELINUX=,使其显示permissivedisabled。需要重新启动才能从此文件中获取更改。

/ 权限

可能导致这种情况的另一个罪魁祸首与根目录的权限有关。 Redhat 的主要解决方案网站上有一个“解决方案”,标题为:什么是“DBus.Error.AccessDenied:SELinux 策略阻止此发件人将此消息发送给此收件人”?

问题是这样的:

/ 的权限已设置为 700 ;恢复到555解决了问题

修复:

确保 / 的权限为 555 ;如果没有通过 chmod 555 / 调整它们

您可以使用 进一步验证这是否是您的问题abrt。当您登录到存在此错误配置的系统时,您通常会看到此消息:

ABRT has detected 1 problem(s). For more info run: abrt-cli list --since 1444824402

调查 ABRT 失败:

$ abrt-cli list --since 1444824402
id 050f5a46e0749583aaf102958b2ab1cc976133d9
reason:         bus.py:122:__new__:DBusException: org.freedesktop.DBus.Error.AccessDenied: An SELinux policy prevents this sender from sending this message to this recipient, 0 matched rules; type="method_call", sender="(null)" (inactive) interface="org.freedesktop.DBus" member="Hello" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)
time:           Wed 14 Oct 2015 06:56:16 AM EDT
cmdline:        /usr/bin/python -Es /usr/bin/firewall-cmd --zone= --change-interface=eth0
package:        firewalld-0.3.9-11.el7
uid:            0 (root)
count:          2
Directory:      /var/spool/abrt/Python-2015-10-14-06:56:16-905
Run 'abrt-cli report /var/spool/abrt/Python-2015-10-14-06:56:16-905' for creating a case in Red Hat Customer Portal

The Autoreporting feature is disabled. Please consider enabling it by issuing
'abrt-auto-reporting enabled' as a user with root privileges

systemd 还报告此故障状态:

$ systemctl --failed
UNIT                      LOAD   ACTIVE SUB    DESCRIPTION
avahi-daemon.service      loaded failed failed Avahi mDNS/DNS-SD Stack
libstoragemgmt.service    loaded failed failed libstoragemgmt plug-in server daemon
ovirt-guest-agent.service loaded failed failed oVirt Guest Agent
postfix.service           loaded failed failed Postfix Mail Transport Agent
rngd.service              loaded failed failed Hardware RNG Entropy Gatherer Daemon
systemd-logind.service    loaded failed failed Login Service
tuned.service             loaded failed failed Dynamic System Tuning Daemon

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

7 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

参考

相关内容