I create my own dbus service for my own requirements and want it to start automatically when someone needs it. For this, I created a .service file similar to this
[D-Bus Service] Name=com.mycompany.servicename Exec=/home/myuser/Workspace/service-start User=myuser
Here I just changed the actual name of the service and the executable, but that is not the point. I double-checked the real names - it exactly matches. I placed this file under the name com.mycompany.servicename.service in the / usr / share / dbus -1 / services folder (I use Ubuntu 11.10) The executable has x permissions for everyone. And here is the problem - when I try to start a client that runs
bus = dbus.SessionBus() bus.get_object('com.mycompany.servicename','/path/to/object')
I get dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name com.mycompany.servicename was not provided by any .service files
An object with the path '/path/to/object' registered immediately after the service starts. I just don't understand why dbus cannot find my .service file. Maybe I missed something? Any ideas?
Edit I was able to start D-BUS automatically using a script. The section of the .service file should be named [D-BUS Service] instead of [D-BUS Service]
source share