6

I am curious how to start my own service for DBus. On official site I have found a lot of information regarding working with DBus services from client point of view, but how to start and develop service not enough: 1) Where should be located interface file ServiceName.xml 2) Where should be located service file ServiceName.service 3) How to launch service manually, not on start of system.

Can anybody help me or provide some usefull links ?

1 Answer 1

6

Make a service that is started by the service manager of the OS (initd, systemd,etc). In that program instantiate the server-side object using the dbus library.

Normally, you'll configure to start the service on boot, but with systemd it's also possible to configure it to start when something connects to specific socket or when something tries to use specific device object. It's called 'socket activation' and 'dbus activation' (see current systemd docs).

If you want to start service manually - then do systemctl disable <service-name> to disable start on boot. To start a service manually: systemctl start <service-name>.

The *.xml files aren't obligatory. Maybe look into other packages to see where they put these files.

The *.systemd files should be in some usual place (see systemd docs) like /usr/lib/systemd/system.

3
  • Thanks you your response !! Actually I could not start my application on System bus, but I have already figured out that it should be done with 'sudo ...' Commented Jan 27, 2017 at 19:43
  • 4
    well, how is this related to dbus-service?
    – Anwar
    Commented Sep 23, 2017 at 6:25
  • @Anwar, it's not different from any other service (apart from the possibility of dbus activation).
    – Velkan
    Commented Sep 23, 2017 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.