How to cope with restarted service?

W. Martin Borgert debacle at debian.org
Thu Jan 27 12:06:52 PST 2011


Hi,

I have a DBus service connected to the system bus written in C
and a client written in Python.

For some reasons the daemon behind the service needs to
restarted sometimes. In consequence the client fails to connect
the service again, because the unique name changed from e.g.
":1.122" to ":1.124".

What is the best way to handle this? I tried reconnecting the
Python client to DBus on the exception:

DBusException: org.freedesktop.DBus.Error.ServiceUnknown:
The name :1.122 was not provided by any .service files

but to me this does not sound like a very elegant solution.

Or is it possible that the service, which is unique in the
system anyway, get's always the same address?

Thanks in advance for any help!



More information about the dbus mailing list