shared: add generic logic for waiting for a unit to enter some state
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Apr 2019 16:54:59 +0000 (18:54 +0200)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Tue, 23 Jun 2020 12:50:50 +0000 (14:50 +0200)
commit5e422a9cea38bd5c7ce54c7bbac612c04418dc41
treeee647393a761a0d34558b2cdaa42ecdd2989b2e5
parent5aefc153b25b42a80942e5c367ce143817551870
shared: add generic logic for waiting for a unit to enter some state

This is a generic implementation of a client-side logic of waiting until
a unit enters or leaves some state.

This is a more generic implementation of the WaitContext logic currently
in systemctl.c, and is supposed to replace it (a later commit does
this). It's similar to bus-wait-for-jobs.c and we probably should fold
that one into it later on.

This code is more powerful and cleaner than the WaitContext logic
however. In addition to waiting for a unit to exit this also allows us
to wait for a unit to leave the "maintainance" state.

This commit only implements the generic logic, and adds no users of it
yet.

(cherry picked from commit 3572d3df8f822d4cf1601428401a837f723771cf)

Related: #1830861
src/shared/bus-wait-for-units.c [new file with mode: 0644]
src/shared/bus-wait-for-units.h [new file with mode: 0644]
src/shared/meson.build