报错
[root@n13 ~]# systemctl start xxx
Job for xxx.service failed because of unavailable resources or another system error.
See "systemctl status xxx.service" and "journalctl -xe" for details.
[root@n13 ~]# journalctl -xefu xxx.service
...
Systemd error: dbus: connection closed by user
...
操作
检查dbus服务
systemctl status dbus.service dbus.socket
重启dbus服务
systemctl restart dbus.service dbus.socket
重启业务服务
systemctl daemon-reload
systemctl start xxx
正常啦~
解析
问题原因:是因为业务调用/var/run/dbus/system_bus_socket这个socket发现连接被关闭导致的。检查节点dbus服务是否正常systemctl status dbus
当dbus服务由于某些异常发生重启,/var/run/dbus/system_bus_socket文件就会被重新创建,旧的socket文件会被删除,因此业务服务无法再往旧的socket发送数据,就会出现连接被关闭的报错。
解决方式:重启业务进程,服务即可重新和新的dbus socket建立连接。