chiark / gitweb /
bus: add sd_bus_track object for tracking peers, and port core over to it
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Mar 2014 00:33:45 +0000 (01:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 3 Mar 2014 01:34:13 +0000 (02:34 +0100)
commit8f8f05a919355095518911135c3d630f4620a9b0
treecb7b75f124dd743d2bcaf366a4a64125d1c34253
parentd9256bac4da4241cb5d97960c899390839f2c6e5
bus: add sd_bus_track object for tracking peers, and port core over to it

This is primarily useful for services that need to track clients which
reference certain objects they maintain, or which explicitly want to
subscribe to certain events. Something like this is done in a large
number of services, and not trivial to do. Hence, let's unify this at
one place.

This also ports over PID 1 to use this to ensure that subscriptions to
job and manager events are correctly tracked. As a side-effect this
makes sure we properly serialize and restore the track list across
daemon reexec/reload, which didn't work correctly before.

This also simplifies how we distribute messages to broadcast to the
direct busses: we only track subscriptions for the API bus and
implicitly assume that all direct busses are subscribed. This should be
a pretty OK simplification since clients connected via direct bus
connections are shortlived anyway.
19 files changed:
Makefile.am
src/core/dbus-client-track.c [deleted file]
src/core/dbus-job.c
src/core/dbus-manager.c
src/core/dbus-manager.h
src/core/dbus-unit.c
src/core/dbus.c
src/core/dbus.h
src/core/job.c
src/core/job.h
src/core/manager.c
src/core/manager.h
src/core/unit.c
src/libsystemd/libsystemd.sym.m4
src/libsystemd/sd-bus/bus-internal.h
src/libsystemd/sd-bus/bus-track.c [new file with mode: 0644]
src/libsystemd/sd-bus/bus-track.h [moved from src/core/dbus-client-track.h with 60% similarity]
src/libsystemd/sd-bus/sd-bus.c
src/systemd/sd-bus.h