daandemeyer / rpms / systemd

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