X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=man%2Fsystemd.socket.xml;h=f989b99f955cb14d0ffac00ba462229194a2cdf4;hb=6b222c4b0227f9914446ac54754aea867f742be4;hp=a10372fceb4a9871295f19d5b778bf66306973eb;hpb=0c697941389b7379c4471bc0a067ede02814bc57;p=thirdparty%2Fsystemd.git diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index a10372fceb4..f989b99f955 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml @@ -1,24 +1,12 @@ - - + - - + systemd.socket systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - @@ -63,11 +51,11 @@ which configure resource control settings for the processes of the socket. - For each socket file, a matching service file must exist, + For each socket unit, a matching service unit must exist, describing the service to start on incoming traffic on the socket (see systemd.service5 - for more information about .service files). The name of the + for more information about .service units). The name of the .service unit is by default the same as the name of the .socket unit, but can be altered with the option described below. Depending on the setting of the @@ -77,8 +65,8 @@ or it must be a template unit named the same way. Example: a socket file foo.socket needs a matching service foo.service if - is set. If - is set, a service template file + is set. If + is set, a service template foo@.service must exist from which services are instantiated for each incoming connection. @@ -103,6 +91,18 @@ 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 network_namespaces7). This + does not mean however that the service activated by a configured socket unit has to be part of the host's network + namespace as well. It is supported and even good practice to run services in their own network namespace (for + example through PrivateNetwork=, see + systemd.exec5), receiving only + the sockets configured through socket-activation from the host's namespace. In such a set-up communication within + the host's network namespace is only permitted through the activation sockets passed in while all sockets allocated + from the service code itself will be associated with the service's own namespace, and thus possibly subject to a a + much more restrictive configuration. @@ -117,10 +117,9 @@ Socket units automatically gain a Before= dependency on the service units they activate. - Socket units referring to file system paths (such as AF_UNIX - sockets or FIFOs) implicitly gain Requires= and - After= dependencies on all mount units - necessary to access those paths. + Socket units referring to file system paths (such as AF_UNIX + sockets or FIFOs) implicitly gain Requires= and After= + dependencies on all mount units necessary to access those paths. Socket units using the BindToDevice= setting automatically gain a BindsTo= and @@ -300,7 +299,7 @@ url="https://www.kernel.org/doc/Documentation/usb/functionfs.txt">USB FunctionFS endpoints location to listen on, for implementation of USB gadget functions. This expects an - absolute file system path of functionfs mount point as the argument. + absolute file system path of FunctionFS mount point as the argument. Behavior otherwise is very similar to the ListenFIFO= directive above. Use this to open the FunctionFS endpoint ep0. When using this option, the @@ -312,16 +311,16 @@ SocketProtocol= - Takes a one of - or . Specifies a socket protocol - (IPPROTO_UDPLITE) UDP-Lite - (IPPROTO_SCTP) SCTP socket respectively. + Takes one of + or . The socket will use the UDP-Lite + (IPPROTO_UDPLITE) or SCTP + (IPPROTO_SCTP) protocol, respectively. BindIPv6Only= - Takes a one of , + Takes one of , or . Controls the IPV6_V6ONLY socket option (see ipv67 @@ -349,16 +348,14 @@ BindToDevice= - Specifies a network interface name to bind - this socket to. If set, traffic will only be accepted from the - specified network interfaces. This controls the - SO_BINDTODEVICE socket option (see socket7 - for details). If this option is used, an implicit dependency - from this socket unit on the network interface device unit - (systemd.device5 - is created. Note that setting this parameter might result in - additional dependencies to be added to the unit (see + Specifies a network interface name to bind this socket to. If set, traffic will only + be accepted from the specified network interfaces. This controls the + SO_BINDTODEVICE socket option (see socket7 for + details). If this option is used, an implicit dependency from this socket unit on the network + interface device unit is created + (see systemd.device5). + Note that setting this parameter might result in additional dependencies to be added to the unit (see above). @@ -366,12 +363,10 @@ SocketUser= SocketGroup= - Takes a UNIX user/group name. When specified, - all AF_UNIX sockets and FIFO nodes in the file system are - owned by the specified user and group. If unset (the default), - the nodes are owned by the root user/group (if run in system - context) or the invoking user/group (if run in user context). - If only a user is specified but no group, then the group is + Takes a UNIX user/group name. When specified, all AF_UNIX + sockets and FIFO nodes in the file system are owned by the specified user and group. If unset (the + default), the nodes are owned by the root user/group (if run in system context) or the invoking + user/group (if run in user context). If only a user is specified but no group, then the group is derived from the user's default group. @@ -404,26 +399,26 @@ 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 + . 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=false, but it + on sockets it got with Accept=no, but it may do so for sockets it got with - Accept=true set. Setting - Accept=true is mostly useful to allow + 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. + 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. @@ -438,11 +433,11 @@ MaxConnections= The maximum number of connections to simultaneously run services instances for, when - is set. If more concurrent + is set. If more concurrent connections are coming in, they will be refused until at least one existing connection is terminated. This setting has no effect on sockets configured with - or datagram sockets. Defaults to + or datagram sockets. Defaults to 64. @@ -456,17 +451,13 @@ KeepAlive= - Takes a boolean argument. If true, the TCP/IP - stack will send a keep alive message after 2h (depending on - the configuration of - /proc/sys/net/ipv4/tcp_keepalive_time) - for all TCP streams accepted on this socket. This controls the - SO_KEEPALIVE socket option (see - socket7 - and the TCP - Keepalive HOWTO for details.) Defaults to - . + Takes a boolean argument. If true, the TCP/IP stack will send a keep alive message + after 2h (depending on the configuration of + /proc/sys/net/ipv4/tcp_keepalive_time) for all TCP streams accepted on this + socket. This controls the SO_KEEPALIVE socket option (see socket7 and + the TCP Keepalive + HOWTO for details.) Defaults to . @@ -483,15 +474,12 @@ KeepAliveIntervalSec= - Takes time (in seconds) as argument between - individual keepalive probes, if the socket option SO_KEEPALIVE - has been set on this socket. This controls - the TCP_KEEPINTVL socket option (see - socket7 - and the TCP - Keepalive HOWTO for details.) Defaults value is 75 - seconds. + Takes time (in seconds) as argument between individual keepalive probes, if the + socket option SO_KEEPALIVE has been set on this socket. This controls the + TCP_KEEPINTVL socket option (see socket7 and + the TCP Keepalive + HOWTO for details.) Defaults value is 75 seconds. @@ -513,17 +501,16 @@ algorithm works by combining a number of small outgoing messages, and sending them all at once. This controls the TCP_NODELAY socket option (see - tcp7 + tcp7). Defaults to . Priority= - Takes an integer argument controlling the - priority for all traffic sent from this socket. This controls - the SO_PRIORITY socket option (see - socket7 - for details.). + Takes an integer argument controlling the priority for all traffic sent from this + socket. This controls the SO_PRIORITY socket option (see socket7 for + details.). @@ -559,12 +546,12 @@ ReceiveBuffer= SendBuffer= - Takes an integer argument controlling the - receive or send buffer sizes of this socket, respectively. - This controls the SO_RCVBUF and SO_SNDBUF socket options (see - socket7 - for details.). The usual suffixes K, M, G are supported and - are understood to the base of 1024. + Takes an integer argument controlling the receive or send buffer sizes of this + socket, respectively. This controls the SO_RCVBUF and + SO_SNDBUF socket options (see socket7 for + details.). The usual suffixes K, M, G are supported and are understood to the base of + 1024. @@ -593,23 +580,20 @@ Mark= - Takes an integer value. Controls the firewall - mark of packets generated by this socket. This can be used in - the firewall logic to filter packets from this socket. This - sets the SO_MARK socket option. See - iptables8 - for details. + Takes an integer value. Controls the firewall mark of packets generated by this + socket. This can be used in the firewall logic to filter packets from this socket. This sets the + SO_MARK socket option. See iptables8 for + details. ReusePort= - Takes a boolean value. If true, allows - multiple - bind2s - to this TCP or UDP port. This controls the SO_REUSEPORT socket - option. See - socket7 - for details. + Takes a boolean value. If true, allows multiple + bind2s to this TCP + or UDP port. This controls the SO_REUSEPORT socket option. See socket7 for + details. @@ -685,37 +669,40 @@ Broadcast= - Takes a boolean value. This controls the - SO_BROADCAST socket option, which allows broadcast datagrams - to be sent from this socket. Defaults to + Takes a boolean value. This controls the SO_BROADCAST socket + option, which allows broadcast datagrams to be sent from this socket. Defaults to . PassCredentials= - Takes a boolean value. This controls the - SO_PASSCRED socket option, which allows - AF_UNIX sockets to receive the - credentials of the sending process in an ancillary message. - Defaults to . + Takes a boolean value. This controls the SO_PASSCRED socket + option, which allows AF_UNIX sockets to receive the credentials of the sending + process in an ancillary message. Defaults to . PassSecurity= - Takes a boolean value. This controls the - SO_PASSSEC socket option, which allows - AF_UNIX sockets to receive the security - context of the sending process in an ancillary message. + Takes a boolean value. This controls the SO_PASSSEC socket + option, which allows AF_UNIX sockets to receive the security context of the + sending process in an ancillary message. Defaults to . + + + + PassPacketInfo= + Takes a boolean value. This controls the IP_PKTINFO, + IPV6_RECVPKTINFO and NETLINK_PKTINFO socket options, which + enable reception of additional per-packet metadata as ancillary message, on + AF_INET, AF_INET6 and AF_UNIX sockets. Defaults to . TCPCongestion= - Takes a string value. Controls the TCP - congestion algorithm used by this socket. Should be one of - "westwood", "veno", "cubic", "lp" or any other available - algorithm supported by the IP stack. This setting applies only - to stream sockets. + Takes a string value. Controls the TCP congestion algorithm used by this + socket. Should be one of westwood, veno, + cubic, lp or any other available algorithm supported by the IP + stack. This setting applies only to stream sockets. @@ -779,15 +766,12 @@ RemoveOnStop= - Takes a boolean argument. If enabled, any file - nodes created by this socket unit are removed when it is - stopped. This applies to AF_UNIX sockets in the file system, - POSIX message queues, FIFOs, as well as any symlinks to them - configured with Symlinks=. Normally, it - should not be necessary to use this option, and is not - recommended as services might continue to run after the socket - unit has been terminated and it should still be possible to - communicate with them via their file system node. Defaults to + Takes a boolean argument. If enabled, any file nodes created by this socket unit are + removed when it is stopped. This applies to AF_UNIX sockets in the file system, + POSIX message queues, FIFOs, as well as any symlinks to them configured with + Symlinks=. Normally, it should not be necessary to use this option, and is not + recommended as services might continue to run after the socket unit has been terminated and it should + still be possible to communicate with them via their file system node. Defaults to off. @@ -850,6 +834,7 @@ systemd1, systemctl1, + systemd-system.conf5, systemd.unit5, systemd.exec5, systemd.kill5,