本文发布于Cylon的收藏册,转载请著名原文链接~


Authorization not available. Check if polkit

Authorization not available. Check if polkit service is running or see debug message for more information.

dbus.socket failed to listen on sockets: Address family not supported by protocol
Failed to listen on D-Bus System Message Bus Socket.

这个问题是因为dbus.socket状态异常,所有依赖dbus的启动都会去通过systemcall连接 dbus,当服务不可用时,所有服务无法以systemd方式正常启动/关闭。需要检查dbus.socket是否正常。本地使用需保证unix套接字的监听时启动的

Did not receive a reply

Failed to open connection to "system" message bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

这是因为你的配置不对,客户端无法连接上

D-Bus 重启后登陆慢

systemd-logind: Failed to connect to system bus: Connection refused
systemd-logind: Failed to fully start up daemon: Connection refused
systemd: systemd-logind.service: main process exited, code=exited, status=1/FAILURE
systemd: Unit systemd-logind.service entered failed state.
systemd: systemd-logind.service failed.
systemd: systemd-logind.service has no holdoff time, scheduling restart.
systemd: start request repeated too quickly for systemd-logind.service
systemd: Unit systemd-logind.service entered failed state.
systemd: systemd-logind.service failed.

dbus[7782]: [system] Failed to activate service 'org.freedesktop.login1': timed out
dbus-daemon: dbus[7782]: [system] Failed to activate service 'org.freedesktop.login1':   timed out

参考:ssh登陆缓慢

systemd-logind主要功能是为每一个登陆session创建一个systemd角度的cgroup管理对象,更方便对session使用cgroup,在dbus服务异常时,systemd-logind会导致登陆缓慢,并不影响正常登陆和ssh登陆。重启dbus.socket后需要也重启systemd-logind

D-Bus 开启远程连接

编辑 /usr/share/dbus-1/system.conf/etc/dbus-1/session.conf

通常情况下生效的是 /etc/dbus-1/system.conf ,需要根据dbus应用是system bus 还是 session bus进行选择配置

<listen>tcp:host=<ip>,bind=*,port=<port>,family=ipv4</listen>
<listen>unix:path=/run/user/<username>/dbus/user_bus_socket</listen>
<listen>unix:tmpdir=/tmp</listen>

<auth>ANONYMOUS</auth>
<allow_anonymous/>

Reference

dbus faq

本文发布于Cylon的收藏册,转载请著名原文链接~

链接:https://www.oomkill.com/2020/09/centos7-dbus-troubleshooting/

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」 许可协议进行许可。