My system is a centos with no gui. I have a server application which "listens" for a method call in a session dbus
. It apparently works fine. I have pydbus
and python3-gobject
installed fine, I also have dbus-launch
working. This is the server application:
from pydbus import SessionBus
from gi.repository import GLib
import time
# Variables / Constants / Instantiation...
bus = SessionBus()
BUS = "org.mybus.demo.test"
loop = GLib.MainLoop()
message_count = 0
class DBusService_XML():
"""
DBus Service XML Definition.
type = "i" for integer, "s" for string, "d" for double, "as" list of string data.
"""
dbus = """
<node>
<interface name="{}">
<method name='greeting'>
<arg type="s" name="input" direction="in">
</arg>
<arg type="s" name="output" direction="out">
</arg>
</method>
</interface>
</node>
""".format(BUS)
def greeting(self, clientName):
"Receive and send arg"
print("{} is asking for name".format(clientName))
return "Hello {}, Im Kyle".format(clientName)
if __name__ == "__main__":
bus.publish(BUS, DBusService_XML())
loop.run()
Now in order to call that server method, from another terminal (same user) I tried to use my client application, which failed, then I tried gdbus
application which failed with the same error as below:
# dbus-launch gdbus call --session --dest org.mybus.demo.test --object-path /org/mybus/demo/test --method org.mybus.demo.test.greeting "Julia"
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.mybus.demo.test was not provided by any .service files
From another machine with Desktop Environment everything works fine. I searched around but couldn't find a way to use dbus in that situation. Can anyone help?