From: Lennart Poettering Date: Wed, 24 Nov 2021 23:11:31 +0000 (+0100) Subject: man: suggest usage of CollectMode= in Accept=yes services X-Git-Tag: v250-rc1~166^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F21508%2Fhead;p=thirdparty%2Fsystemd.git man: suggest usage of CollectMode= in Accept=yes services --- diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index f977f115415..e4f1f544cb9 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml @@ -392,36 +392,32 @@ Accept= - Takes a boolean argument. If yes, a service - instance is spawned for each incoming connection and only the - connection socket is passed to it. If no, all listening - sockets themselves are passed to the started service unit, and - only one service unit is spawned for all connections (also see - above). This value is ignored for datagram sockets and FIFOs - where a single service unit unconditionally handles all - incoming traffic. Defaults to . For - performance reasons, it is recommended to write new daemons - only in a way that is suitable for - . A daemon listening on an - AF_UNIX socket may, but does not need to, - call - close2 - on the received socket before exiting. However, it must not - unlink the socket from a file system. It should not invoke - shutdown2 - on sockets it got with Accept=no, but it - may do so for sockets it got with - Accept=yes set. Setting - Accept=yes is mostly useful to allow - daemons designed for usage with - inetd8 - to work unmodified with systemd socket - activation. + Takes a boolean argument. If yes, a service instance is spawned for each incoming + connection and only the connection socket is passed to it. If no, all listening sockets themselves + are passed to the started service unit, and only one service unit is spawned for all connections + (also see above). This value is ignored for datagram sockets and FIFOs where a single service unit + unconditionally handles all incoming traffic. Defaults to . For performance + reasons, it is recommended to write new daemons only in a way that is suitable for + . A daemon listening on an AF_UNIX socket may, but + does not need to, call + close2 on the + received socket before exiting. However, it must not unlink the socket from a file system. It should + not invoke + shutdown2 on + sockets it got with Accept=no, but it may do so for sockets it got with + Accept=yes set. Setting Accept=yes is mostly useful to allow + daemons designed for usage with inetd8 to work + unmodified with systemd socket activation. For IPv4 and IPv6 connections, the REMOTE_ADDR environment variable will contain the remote IP address, and REMOTE_PORT will contain the remote port. This is the same as the format used by CGI. For SOCK_RAW, the port is the IP - protocol. + protocol. + + It is recommended to set CollectMode=inactive-or-failed for service + instances activated via Accept=yes, to ensure that failed connection services are + cleaned up and released from memory, and do not accumulate.