From: Lennart Poettering Date: Wed, 8 Nov 2023 10:35:35 +0000 (+0100) Subject: service: say explicitly that people should not use different NonBlocking= settings... X-Git-Tag: v255-rc2~80^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28562194c49003b8f6af0df24c33b4f6d8a8df1e;p=thirdparty%2Fsystemd.git service: say explicitly that people should not use different NonBlocking= settings if they share socket units between multiple service units Fixes: #29600 --- diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 735c98d1d62..123f1db30de 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -1064,14 +1064,25 @@ NonBlocking= - Set the O_NONBLOCK flag for all file descriptors passed via socket-based - activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), excluding those passed - in via the file descriptor storage logic (see FileDescriptorStoreMax= for details), will - have the O_NONBLOCK flag set and hence are in non-blocking mode. This option is only + Set the O_NONBLOCK flag for all file descriptors passed via + socket-based activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), + excluding those passed in via the file descriptor storage logic (see + FileDescriptorStoreMax= for details), will have the + O_NONBLOCK flag set and hence are in non-blocking mode. This option is only useful in conjunction with a socket unit, as described in - systemd.socket5 and has no - effect on file descriptors which were previously saved in the file-descriptor store for example. Defaults to - false. + systemd.socket5 + and has no effect on file descriptors which were previously saved in the file-descriptor store for + example. Defaults to false. + + Note that if the same socket unit is configured to be passed to multiple service units (via the + Sockets= setting, see below), and these services have different + NonBlocking= configurations, the precise state of O_NONBLOCK + depends on the order in which these services are invoked, and will possibly change after service code + already took possession of the socket file descriptor, simply because the + O_NONBLOCK state of a socket is shared by all file descriptors referencing + it. Hence it is essential that all services sharing the same socket use the same + NonBlocking= configuration, and do not change the flag in service code + either.