572a44
From 6fe43c70ac008feaf26f49420c559565e3b50528 Mon Sep 17 00:00:00 2001
572a44
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
572a44
Date: Mon, 30 Dec 2013 00:11:30 -0500
572a44
Subject: [PATCH] man: expand on some more subtle points in systemd.socket(5)
572a44
572a44
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=727708#1694
572a44
---
572a44
 man/systemd.socket.xml | 67 ++++++++++++++++++++++++++++++++++++--------------
572a44
 1 file changed, 49 insertions(+), 18 deletions(-)
572a44
572a44
diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml
572a44
index ac3127d..570a6fb 100644
572a44
--- a/man/systemd.socket.xml
572a44
+++ b/man/systemd.socket.xml
572a44
@@ -85,21 +85,26 @@
572a44
                 processes of the socket.</para>
572a44
 
572a44
                 <para>For each socket file a matching service file
572a44
-                (see
572a44
+                must exist, describing the service to start on
572a44
+                incoming traffic on the socket (see
572a44
                 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
572a44
-                for details) must exist, describing the service to
572a44
-                start on incoming traffic on the socket. Depending on
572a44
-                the setting of <option>Accept=</option> (see below),
572a44
-                this must either be named like the socket unit, but
572a44
-                with the suffix replaced; or it must be a template
572a44
-                file named the same way. Example: a socket file
572a44
+                for more information about .service files). The name
572a44
+                of the .service unit is by default the same as the
572a44
+                name of the .socket unit, but can be altered with
572a44
+                <option>Service=</option> option described below.
572a44
+                Depending on the setting of <option>Accept=</option>
572a44
+                option described below, this .service unit must either
572a44
+                be named like the .socket unit, but with the suffix
572a44
+                replaced, unless overridden with
572a44
+                <option>Service=</option>; or it must be a template
572a44
+                unit named the same way. Example: a socket file
572a44
                 <filename>foo.socket</filename> needs a matching
572a44
                 service <filename>foo.service</filename> if
572a44
                 <option>Accept=false</option> is set. If
572a44
-                <option>Accept=true</option> is set, a service template
572a44
-                file <filename>foo@.service</filename> must exist from
572a44
-                which services are instantiated for each incoming
572a44
-                connection.</para>
572a44
+                <option>Accept=true</option> is set, a service
572a44
+                template file <filename>foo@.service</filename> must
572a44
+                exist from which services are instantiated for each
572a44
+                incoming connection.</para>
572a44
 
572a44
                 <para>Unless <varname>DefaultDependencies=</varname>
572a44
                 is set to <option>false</option>, socket units will
572a44
@@ -116,9 +121,21 @@
572a44
                 boot or late system shutdown should disable this
572a44
                 option.</para>
572a44
 
572a44
+		<para>Socket units will have a
572a44
+		<varname>Before=</varname> dependency on the service
572a44
+		which they trigger added implicitly. No implicit
572a44
+		<varname>WantedBy=</varname> or
572a44
+		<varname>RequiredBy=</varname> dependency from the
572a44
+		socket to the service is added. This means that the
572a44
+		service may be started without the socket, in which
572a44
+		case it must be able to open sockets by itself. To
572a44
+		prevent this, an explicit <varname>Requires=</varname>
572a44
+		dependency may be added.</para>
572a44
+
572a44
                 <para>Socket units may be used to implement on-demand
572a44
                 starting of services, as well as parallelized starting
572a44
-                of services.</para>
572a44
+                of services. See the blog stories linked at the end
572a44
+                for introduction.</para>
572a44
 
572a44
                 <para>Note that the daemon software configured for
572a44
                 socket activation with socket units needs to be able
572a44
@@ -221,12 +238,23 @@
572a44
                                 of any of these options will have no
572a44
                                 effect.</para>
572a44
 
572a44
+                                <para>It is also possible to have more
572a44
+                                than one socket unit for the same
572a44
+                                service when using
572a44
+                                <varname>Service=</varname>, and the
572a44
+                                service will receive all the sockets
572a44
+                                configured in all the socket units.
572a44
+                                Sockets configured in one unit are
572a44
+                                passed in the order of configuration,
572a44
+                                but no ordering between socket units
572a44
+                                is specified.</para>
572a44
+
572a44
                                 <para>If an IP address is used here,
572a44
                                 it is often desirable to listen on it
572a44
                                 before the interface it is configured
572a44
                                 on is up and running, and even
572a44
                                 regardless of whether it will be up and
572a44
-                                running ever at all. To deal with this
572a44
+                                running at any point. To deal with this
572a44
                                 it is recommended to set the
572a44
                                 <varname>FreeBind=</varname> option
572a44
                                 described below.</para></listitem>
572a44
@@ -687,11 +715,14 @@
572a44
                                 <term><varname>Service=</varname></term>
572a44
                                 <listitem><para>Specifies the service
572a44
                                 unit name to activate on incoming
572a44
-                                traffic. This defaults to the service
572a44
-                                that bears the same name as the socket
572a44
-                                (ignoring the different suffixes). In
572a44
-                                most cases it should not be necessary
572a44
-                                to use this option.</para></listitem>
572a44
+                                traffic. This setting is only allowed
572a44
+                                for sockets with
572a44
+                                <varname>Accept=no</varname>. It
572a44
+                                defaults to the service that bears the
572a44
+                                same name as the socket (with the
572a44
+                                suffix replaced). In most cases it
572a44
+                                should not be necessary to use this
572a44
+                                option.</para></listitem>
572a44
                         </varlistentry>
572a44
 
572a44
                 </variablelist>