New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
man: document that sd_notify() is racy in some cases #5239
Conversation
man/systemd.service.xml
Outdated
<varname>WatchdogSec=</varname> (see above). If those options are used but <varname>NotifyAccess=</varname> is | ||
not configured, it will be implicitly set to <option>main</option>.</para> | ||
|
||
<para>Note that <function>sd_notify()</function> notifications maybe attributed to units correctly only if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be 'may be' here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed! thanks for the pointer! will force push fix shortly.
8e74c7d
to
59ef39d
Compare
thanks for clarifying this point. LGTM |
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i force pushed a new version that adds this there, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I'm not sure the documentation makes it clear why does this service work
[Service]
NotifyAccess=main
ExecStart=/bin/sh -c 'sleep 5; systemd-notify --ready; sleep 1000'
Type=notify
And this service doesn't work
[Service]
NotifyAccess=main
ExecStart=/bin/sh -c 'sleep 5; systemd-notify --ready; sleep 1000'
Type=notify
User=some-non-root
Maybe, this doesn't really matter
59ef39d
to
b3bb647
Compare
I added another commit now that explains the faking of the PID we do in the systemd-notify tool, which is hopefully useful to explain why the systemd-notify service examples @evverx provided behave the way they do. |
Document that sd_notify() is racy in some cases, as a follow-up to opencontainers/runc#1308 (comment)