portablectl: block when stopping a unit on detach (--now)
authorLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 12 Feb 2020 17:27:43 +0000 (17:27 +0000)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 18 Feb 2020 12:02:53 +0000 (12:02 +0000)
commit31c33315b3e9897fa59776c888ffba5d83192c7a
tree8ccf0a26beaec87338eaca3c536bc2e50f1a67f4
parentd4ffda38716d33dbc17faaa12034ccb77d0ed68b
portablectl: block when stopping a unit on detach (--now)

If portablectl detach --now is used, there's a possible race condition
where the unit is not stopped in time before the detach is attempted,
which causes it to fail.
Add a DBUS call to block after starting/stopping if --now is passed,
and add a --no-block parameter to skip it optionally when starting,
since it is not necessary in that case for correct functioning.
man/portablectl.xml
src/portable/portablectl.c