[systemd-devel] systemd DBus services exit when they have clients
Stef Walter
stefw at redhat.com
Fri Nov 14 08:46:12 PST 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 14.11.2014 16:39, Lennart Poettering wrote:
> 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...
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.
Stef
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iEYEARECAAYFAlRmMdQACgkQe/sRCNknZa/ZJACg8FzwUH0iWtYBhS6uSpjzFimJ
7JwAn3sTe6S/VF5bqNI2kSH2c2VZ1B9K
=WZOu
-----END PGP SIGNATURE-----
More information about the systemd-devel
mailing list