本文介绍了系统服务未使用dbus接口启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动systemd服务usnig dbus服务。我正在遵循以下提到的链接的示例5:



我的dbus服务是:

  [D-BUS服务] 
Name = com.native.Test_Dbus_060
Exec = / usr / sbin / server_060
用户=应用程序
StandardOutput = tty
TTYPath = / dev / ttyS0
SystemdService = com.native.Test_Dbus_060.service

我的系统com.native.Test_Dbus_060.service是:

  [Unit] 
描述= dbus测试服务器

[Service]
Type = dbus
BusName = com.native.Test_Dbus_060
ExecStart = / usr / sbin / server_060
StandardOutput = tty
TTYPath = / dev / ttyS0

[安装]

WantedBy =多用户目标

现在,当我尝试激活 com.native.Test_Dbus_060.service 服务时通过获得上述在dbus中提到了公交车,它没有启动。
server_060和client_060都使用dbus API进行IPC。



注意:当不使用systemd服务和dbus服务而直接使用时,我的server_060和client_060通信良好。 / p>

我的第一个查询是,是否可以启动这种类型的systemd服务?
,如果是,那么为什么我的情况不起作用?

解决方案

好吧,如果您仔细看一下在您引用的页面上,您会注意到此注释:


I am trying to start systemd service usnig dbus service. I am following the example 5 of below mentioned link:http://www.freedesktop.org/software/systemd/man/systemd.service.html

My dbus service is:

[D-BUS Service]
Name=com.native.Test_Dbus_060
Exec=/usr/sbin/server_060
User=apps
StandardOutput=tty
TTYPath=/dev/ttyS0
SystemdService=com.native.Test_Dbus_060.service

my systemd com.native.Test_Dbus_060.service is:

[Unit]
Description=dbus test server

[Service]
Type=dbus
BusName=com.native.Test_Dbus_060
ExecStart=/usr/sbin/server_060
StandardOutput=tty
TTYPath=/dev/ttyS0

[Install]

WantedBy=multi-user.target

Now when I am trying to activate com.native.Test_Dbus_060.service service by acquiring the above mentioned bus in dbus, its not starting.Both server_060 and client_060 are using dbus APIs for IPC.

NOTE: my server_060 and client_060 are communicating fine when using directly without systemd service and dbus service.

Here my first query is, whether such type of systemd service start possible?and if yes then why it is not working in my case?

解决方案

Well, if you have a closer look at the page you referenced you'll notice this note:

这篇关于系统服务未使用dbus接口启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-09 19:14