|
1036 | 1036 |
|
1037 | 1037 | <varlistentry> |
1038 | 1038 | <term><varname>NonBlocking=</varname></term> |
1039 | | - <listitem><para>Set the <constant>O_NONBLOCK</constant> flag for all file descriptors passed via socket-based |
1040 | | - activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), excluding those passed |
1041 | | - in via the file descriptor storage logic (see <varname>FileDescriptorStoreMax=</varname> for details), will |
1042 | | - have the <constant>O_NONBLOCK</constant> flag set and hence are in non-blocking mode. This option is only |
| 1039 | + <listitem><para>Set the <constant>O_NONBLOCK</constant> flag for all file descriptors passed via |
| 1040 | + socket-based activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), |
| 1041 | + excluding those passed in via the file descriptor storage logic (see |
| 1042 | + <varname>FileDescriptorStoreMax=</varname> for details), will have the |
| 1043 | + <constant>O_NONBLOCK</constant> flag set and hence are in non-blocking mode. This option is only |
1043 | 1044 | useful in conjunction with a socket unit, as described in |
1044 | | - <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry> and has no |
1045 | | - effect on file descriptors which were previously saved in the file-descriptor store for example. Defaults to |
1046 | | - false.</para></listitem> |
| 1045 | + <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 1046 | + and has no effect on file descriptors which were previously saved in the file-descriptor store for |
| 1047 | + example. Defaults to false.</para> |
| 1048 | + |
| 1049 | + <para>Note that if the same socket unit is configured to be passed to multiple service units (via the |
| 1050 | + <varname>Sockets=</varname> setting, see below), and these services have different |
| 1051 | + <varname>NonBlocking=</varname> configurations, the precise state of <constant>O_NONBLOCK</constant> |
| 1052 | + depends on the order in which these services are invoked, and will possibly change after service code |
| 1053 | + already took possession of the socket file descriptor, simply because the |
| 1054 | + <constant>O_NONBLOCK</constant> state of a socket is shared by all file descriptors referencing |
| 1055 | + it. Hence it is essential that all services sharing the same socket use the same |
| 1056 | + <varname>NonBlocking=</varname> configuration, and do not change the flag in service code |
| 1057 | + either.</para></listitem> |
1047 | 1058 | </varlistentry> |
1048 | 1059 |
|
1049 | 1060 | <varlistentry> |
|
0 commit comments