[systemd-devel] systemd DBus services exit when they have clients

Lennart Poettering lennart at poettering.net
Fri Nov 14 08:39:28 PST 2014


On Fri, 14.11.14 16:06, Stef Walter (stefw at redhat.com) wrote:

> > I guess the idea is that many clients (e.g. gnome-settings-daemon)
> > would make a few calls on startup and then continue running for
> > days without ever touching the service again.
> > 
> > What are the actual problems caused by this? (I'm guessing
> > something might rely on `hostnamed` watching
> > /proc/sys/kernel/hostname, or things like that?)
> 
> In the case of Cockpit we have proxies that expose the properties of
> DBus interfaces from the service. And you can watch that proxy to see
> when stuff changes. When the service goes away the proxy becomes
> invalid. Here's an example I just put together:
> 
> http://stef.thewalter.net/using-dbus-from-javascript-in-cockpit.html
> 
> But since Cockpit 0.31 we just ping the DBus service so it doesn't
> feel lonely, and knows we're still interested ... for as long as we're
> actually interested:
> 
> https://github.com/cockpit-project/cockpit/commit/aee825ef6d5ec4a6f8a4f25bc208b6f5ed4a9e96

If you use proxies like that you should simply make sure they are not
invalidated when the service goes away. 

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...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list