diff options
author | Luca Boccassi <bluca@debian.org> | 2024-01-17 17:59:26 +0100 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2024-01-18 18:22:12 +0100 |
commit | d156e66f826e3eaa4b7d26212870dcfdfd3a16a3 (patch) | |
tree | 093438b69f183a34e859624e01e9b9a77ca02b28 | |
parent | logind-action: also check .target unit state when selecting sleep action (diff) | |
download | systemd-d156e66f826e3eaa4b7d26212870dcfdfd3a16a3.tar.xz systemd-d156e66f826e3eaa4b7d26212870dcfdfd3a16a3.zip |
man: add more suggestions on how to use StartUnit and JobRemoved
This is not immediately clear for users, so spell out the preferred pattern
clearly in the D-Bus documentation.
-rw-r--r-- | man/org.freedesktop.systemd1.xml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml index e2814b7e42..5f1a5988a0 100644 --- a/man/org.freedesktop.systemd1.xml +++ b/man/org.freedesktop.systemd1.xml @@ -1291,7 +1291,13 @@ node /org/freedesktop/systemd1 { and terminate all units that aren't dependencies of it. If <literal>ignore-dependencies</literal>, it will start a unit but ignore all its dependencies. If <literal>ignore-requirements</literal>, it will start a unit but only ignore the requirement dependencies. It is not recommended to make use of the - latter two options. On completion, this method returns the newly created job object.</para> + latter two options. On reply, if successful, this method returns the newly created job object + which has been enqueued for asynchronous activation. Callers that want to track the outcome of the + actual start operation need to monitor the result of this job. This can be achieved in a race-free + manner by first subscribing to the <function>JobRemoved()</function> signal, then calling + <function>StartUnit()</function> and using the returned job object to filter out unrelated + <function>JobRemoved()</function> signals, until the desired one is received, which will then carry + the result of the start operation.</para> <para><function>StartUnitReplace()</function> is similar to <function>StartUnit()</function> but replaces a job that is queued for one unit by a job for another unit.</para> |