diff options
author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2020-04-28 15:39:53 +0200 |
---|---|---|
committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2020-04-30 23:52:59 +0200 |
commit | 5ec7a9947edd3dadc3546f02273e9b5a4e67c125 (patch) | |
tree | 0286e8e5267fba75ab1d9ba0dfc5995a35998a7e /man/systemd.service.xml | |
parent | Introduce sd_notify_barrier (diff) | |
download | systemd-5ec7a9947edd3dadc3546f02273e9b5a4e67c125.tar.xz systemd-5ec7a9947edd3dadc3546f02273e9b5a4e67c125.zip |
man: sd_notify() race is gone with sd_notify_barrier()
Add note for change of behaviour in systemd-notify, where parent pid trick
is only used when --no-block is passed, and with enough privileges ofcourse.
Also, fix a small error in systemd(1).
Diffstat (limited to 'man/systemd.service.xml')
-rw-r--r-- | man/systemd.service.xml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 398fd69b46..bba867f799 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -959,7 +959,14 @@ <option>exec</option>. Conversely, if an auxiliary process of the unit sends an <function>sd_notify()</function> message and immediately exits, the service manager might not be able to properly attribute the message to the unit, and thus will ignore it, even if - <varname>NotifyAccess=</varname><option>all</option> is set for it.</para></listitem> + <varname>NotifyAccess=</varname><option>all</option> is set for it.</para> + + <para>Hence, to eliminate all race conditions involving lookup of the client's unit and attribution of notifications + to units correctly, <function>sd_notify_barrier()</function> may be used. This call acts as a synchronization point + and ensures all notifications sent before this call have been picked up by the service manager when it returns + successfully. Use of <function>sd_notify_barrier()</function> is needed for clients which are not invoked by the + service manager, otherwise this synchronization mechanism is unnecessary for attribution of notifications to the + unit.</para></listitem> </varlistentry> <varlistentry> |