使用基於centos7 dbus問題總結


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套接字的監聽時啟動的

dbus重啟導致登陸慢

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

dbus開啟遠程連接

編輯 /usr/share/dbus-1/system.conf/etc/dbus-1/session.conf

<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/>

參考:dbus-send使用

參考:Linux DBus遠程TCP連接失敗

dbus faq

faq


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM