From 84119b0353e5a11fecde843baa7c7bf83dccf617 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 6 Feb 2017 13:49:44 +0100 Subject: [PATCH] man: document that sd_notify() is racy in some cases --- man/sd_notify.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/man/sd_notify.xml b/man/sd_notify.xml index ae6792dd7..f3f326976 100644 --- a/man/sd_notify.xml +++ b/man/sd_notify.xml @@ -268,6 +268,15 @@ systemd.service5 for details. + Note that sd_notify() notifications may be attributed to units correctly only if either + the sending process is still around at the time PID 1 processes the message, or if the sending process is + explicitly runtime-tracked by the service manager. The latter is the case if the service manager originally forked + off the process, i.e. on all processes that match NotifyAccess= or + NotifyAccess=. Conversely, if an auxiliary process of the unit sends an + sd_notify() 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 + NotifyAccess= is set for it. + sd_notifyf() is similar to sd_notify() but takes a printf()-like format string plus -- 2.30.2