[systemd-devel] dbus API for unit state change?

Brandon Philips brandon at ifup.co
Sun Oct 6 21:11:40 PDT 2013


On Sun, Oct 6, 2013 at 3:10 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> So, yeah, if you respond to each UnitNew signal you get with a property
> Get/GetAll call, then this will result in endless ping pong, which is
> certainly not a good idea.
>
> What are you trying to do? Write some tool that tracks all units that
> are loaded?

Yes, I want to register services into a networked service registry. An
example use case would be an HTTP load balancer that is service
registry aware and adds machines to the load balancer based on certain
unit files appearing/leaving.

An alternative solution is making a user explicitly add a
service-registry-notifier at .service to my-application.service.wants but
I wanted to avoid making registration a special case. For example:
https://gist.github.com/philips/6710008

Maybe there is a middle ground solution? Does it makes sense to send
LoadState with UnitNew? I will have to look tomorrow because I think
without that trying to do other things gets racy with transient units.

Thanks,

Brandon


More information about the systemd-devel mailing list