systemd service not starting using dbus interface

天大地大妈咪最大 提交于 2019-12-10 10:35:07

问题


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?


回答1:


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

For bus-activatable services, don't include a "[Install]" section in the systemd service file, but use the SystemdService= option in the corresponding DBus service file, for example (/usr/share/dbus-1/system-services/org.example.simple-dbus-service.service)



来源:https://stackoverflow.com/questions/30052344/systemd-service-not-starting-using-dbus-interface

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!