systemd服务无法连接到会话d-bus [英] systemd servicefailed to connect to session d-bus

查看:482
本文介绍了systemd服务无法连接到会话d-bus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在启动过程中必须连接到会话dbus的应用程序。如果我手动启动应用程序或以initd启动,则它正在启动并连接到会话dbus。但是,如果我通过给出命令systemctl --user start my-service来启动systemd,它位于路径 / etc / systemd / user中,则会显示以下错误无法连接到总线:没有这样的文件或目录 。可能的原因是什么?

I have a application which has to connect to session dbus during bootup. If I start my application manually or start with initd, it is starting and connecting to session dbus. But if I start through systemd by giving command as systemctl --user start my-service which is in the path "/etc/systemd/user", it is showing the following error "Failed to connect to bus: No such file or directory". What can be the possible reasons?

服务文件如下:

[Unit]
Description=dummy application to connect to session dbus.


[Service]
Type=dbus
BusName=org.client
ExecStart=/usr/local/bin/DummyApp
TimeoutSec=300
WatchdogSec=20

[Install]
WantedBy=basic.target

操作系统是Ubuntu 16.04(64位)。
有人可以帮我吗?

the operating system is Ubuntu 16.04(64 bit). can anyone help me with this?

推荐答案

如果使用 systemctl --user,则用户守护程序必须已经在运行。通常,它是由桌面启动的。因此,不仅使用哪种操作系统很重要,而且还需要检查运行的桌面版本。

If you use "systemctl --user" then a user daemon must already be running. In general that one is started by the desktop. So it is not only important which operating system you use but you also need to check the desktop variant that is run.

这篇关于systemd服务无法连接到会话d-bus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆