[systemd-devel] systemd DBus services exit when they have clients
Simon McVittie
simon.mcvittie at collabora.co.uk
Fri Nov 14 08:56:02 PST 2014
On 14/11/14 16:46, Stef Walter wrote:
> On 14.11.2014 16:39, Lennart Poettering wrote:
>> The services like hostnamed explicitly provide stable object
>> paths and suchlike so that clients can completely ignore when
>> the services go away and come back...
>
> Most DBus services are not like that, and usually callers do need
> to be aware of a service that goes away.
>
> But I guess we could provide an option that instructs the proxy to
> ignore a service's absence for use with systemd and any other
> stateless services like this.
Er, don't D-Bus frameworks have that option already?
dbus-python has get_object() for stateful services and
get_object(follow_name_owner_changes=True) for stateless.
dbus-glib (which is otherwise awful, don't use it) has
dbus_g_proxy_new_for_name_owner() for stateful and
dbus_g_proxy_new_for_name() for stateless.
In both cases, the proxy will watch the name owner and keep a record
of it, so that it can trigger a signal subscription on signals that
come from from the current owner of the desired name.
(Having said that, I can't find whether GDBus has a way to get a proxy
for a stateless service. Perhaps it doesn't yet?)
Regards,
S
More information about the systemd-devel
mailing list