Wait for restarted unit to be ready
Add Reply
Jonathan Gold
2018-05-04 20:47:15 UTC
Raw Message
I'm working on some code that handles restarting systemd units via dbus,
and I want to make sure that my logic is correct.

My goal is to restart a unit, and wait for it to be active before my
function returns. Once I've asked the unit to restart, I am watching the
`JobRemoved` signal for messages containing the unit name and handling the
result accordingly. If the signal result is "done" my function returns, and
otherwise it errors. Is this the correct way to wait for unit readiness?