diff --git a/man/sd_listen_fds.xml b/man/sd_listen_fds.xml index 9a66ee33ba..4973718ef6 100644 --- a/man/sd_listen_fds.xml +++ b/man/sd_listen_fds.xml @@ -54,24 +54,19 @@ (i.e. SD_LISTEN_FDS_START), the remaining descriptors follow at 4, 5, 6, …, if any. - If a daemon receives more than one file descriptor, they - will be passed in the same order as configured in the systemd - socket unit file (see - systemd.socket5 - for details). Nonetheless, it is recommended to verify the correct - socket types before using them. To simplify this checking, the - functions + If a daemon receives more than one file descriptor, they will be passed in the same order as + configured in the systemd socket unit file (see + systemd.socket5 for + details) — if there's only one such file (see below). Nonetheless, it is recommended to verify the + correct socket types before using them. To simplify this checking, the functions sd_is_fifo3, sd_is_socket3, sd_is_socket_inet3, - sd_is_socket_unix3 - are provided. In order to maximize flexibility, it is recommended - to make these checks as loose as possible without allowing - incorrect setups. i.e. often, the actual port number a socket is - bound to matters little for the service to work, hence it should - not be verified. On the other hand, whether a socket is a datagram - or stream socket matters a lot for the most common program logics - and should be checked. + sd_is_socket_unix3 are + provided. In order to maximize flexibility, it is recommended to make these checks as loose as possible + without allowing incorrect setups. i.e. often, the actual port number a socket is bound to matters little + for the service to work, hence it should not be verified. On the other hand, whether a socket is a + datagram or stream socket matters a lot for the most common program logics and should be checked. This function call will set the FD_CLOEXEC flag for all passed file descriptors to avoid further inheritance to children diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 5aec511724..124fa383ab 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -1028,20 +1028,24 @@ FileDescriptorStoreMax= - Configure how many file descriptors may be stored in the service manager for the service using + Configure how many file descriptors may be stored in the service manager for the + service using sd_pid_notify_with_fds3's - FDSTORE=1 messages. This is useful for implementing services that can restart after an - explicit request or a crash without losing state. Any open sockets and other file descriptors which should not - be closed during the restart may be stored this way. Application state can either be serialized to a file in - /run, or better, stored in a - memfd_create2 memory file - descriptor. Defaults to 0, i.e. no file descriptors may be stored in the service manager. All file descriptors - passed to the service manager from a specific service are passed back to the service's main process on the next - service restart. Any file descriptors passed to the service manager are automatically closed when - POLLHUP or POLLERR is seen on them, or when the service is fully - stopped and no job is queued or being executed for it. If this option is used, NotifyAccess= - (see above) should be set to open access to the notification socket provided by systemd. If - NotifyAccess= is not set, it will be implicitly set to + FDSTORE=1 messages. This is useful for implementing services that can restart + after an explicit request or a crash without losing state. Any open sockets and other file + descriptors which should not be closed during the restart may be stored this way. Application state + can either be serialized to a file in /run, or better, stored in a + memfd_create2 + memory file descriptor. Defaults to 0, i.e. no file descriptors may be stored in the service + manager. All file descriptors passed to the service manager from a specific service are passed back + to the service's main process on the next service restart (see + sd_listen_fds3 for + details about the precise protocol used and the order in which the file descriptors are passed). Any + file descriptors passed to the service manager are automatically closed when + POLLHUP or POLLERR is seen on them, or when the service is + fully stopped and no job is queued or being executed for it. If this option is used, + NotifyAccess= (see above) should be set to open access to the notification socket + provided by systemd. If NotifyAccess= is not set, it will be implicitly set to . diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index f989b99f95..29ce0b1c20 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml @@ -81,16 +81,14 @@ services, as well as parallelized starting of services. See the blog stories linked at the end for an introduction. - Note that the daemon software configured for socket - activation with socket units needs to be able to accept sockets - from systemd, either via systemd's native socket passing interface - (see - sd_listen_fds3 - for details) or via the traditional - inetd8-style - socket passing (i.e. sockets passed in via standard input and - output, using StandardInput=socket in the - service file). + Note that the daemon software configured for socket activation with socket units needs to be able + to accept sockets from systemd, either via systemd's native socket passing interface (see + sd_listen_fds3 for + details about the precise protocol used and the order in which the file descriptors are passed) or via + traditional inetd8-style + socket passing (i.e. sockets passed in via standard input and output, using + StandardInput=socket in the service file). All network sockets allocated through .socket units are allocated in the host's network namespace (see