diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-30 00:11:30 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-30 00:17:16 -0500 |
commit | 3cf148f307e6450aa3411968f59a2563fe9cb154 (patch) | |
tree | 3117600aba2fe8d4a753c3365911a5aee060b2f6 | |
parent | 819c7e4fa4422af1298a0bf074b1f5644e46fa13 (diff) |
man: expand on some more subtle points in systemd.socket(5)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=727708#1694
-rw-r--r-- | man/systemd.socket.xml | 67 |
1 files changed, 49 insertions, 18 deletions
diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index d1879fa9e..946c30a75 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml | |||
@@ -85,21 +85,26 @@ | |||
85 | processes of the socket.</para> | 85 | processes of the socket.</para> |
86 | 86 | ||
87 | <para>For each socket file a matching service file | 87 | <para>For each socket file a matching service file |
88 | (see | 88 | must exist, describing the service to start on |
89 | incoming traffic on the socket (see | ||
89 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry> | 90 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
90 | for details) must exist, describing the service to | 91 | for more information about .service files). The name |
91 | start on incoming traffic on the socket. Depending on | 92 | of the .service unit is by default the same as the |
92 | the setting of <option>Accept=</option> (see below), | 93 | name of the .socket unit, but can be altered with |
93 | this must either be named like the socket unit, but | 94 | <option>Service=</option> option described below. |
94 | with the suffix replaced; or it must be a template | 95 | Depending on the setting of <option>Accept=</option> |
95 | file named the same way. Example: a socket file | 96 | option described below, this .service unit must either |
97 | be named like the .socket unit, but with the suffix | ||
98 | replaced, unless overridden with | ||
99 | <option>Service=</option>; or it must be a template | ||
100 | unit named the same way. Example: a socket file | ||
96 | <filename>foo.socket</filename> needs a matching | 101 | <filename>foo.socket</filename> needs a matching |
97 | service <filename>foo.service</filename> if | 102 | service <filename>foo.service</filename> if |
98 | <option>Accept=false</option> is set. If | 103 | <option>Accept=false</option> is set. If |
99 | <option>Accept=true</option> is set, a service template | 104 | <option>Accept=true</option> is set, a service |
100 | file <filename>foo@.service</filename> must exist from | 105 | template file <filename>foo@.service</filename> must |
101 | which services are instantiated for each incoming | 106 | exist from which services are instantiated for each |
102 | connection.</para> | 107 | incoming connection.</para> |
103 | 108 | ||
104 | <para>Unless <varname>DefaultDependencies=</varname> | 109 | <para>Unless <varname>DefaultDependencies=</varname> |
105 | is set to <option>false</option>, socket units will | 110 | is set to <option>false</option>, socket units will |
@@ -116,9 +121,21 @@ | |||
116 | boot or late system shutdown should disable this | 121 | boot or late system shutdown should disable this |
117 | option.</para> | 122 | option.</para> |
118 | 123 | ||
124 | <para>Socket units will have a | ||
125 | <varname>Before=</varname> dependency on the service | ||
126 | which they trigger added implicitly. No implicit | ||
127 | <varname>WantedBy=</varname> or | ||
128 | <varname>RequiredBy=</varname> dependency from the | ||
129 | socket to the service is added. This means that the | ||
130 | service may be started without the socket, in which | ||
131 | case it must be able to open sockets by itself. To | ||
132 | prevent this, an explicit <varname>Requires=</varname> | ||
133 | dependency may be added.</para> | ||
134 | |||
119 | <para>Socket units may be used to implement on-demand | 135 | <para>Socket units may be used to implement on-demand |
120 | starting of services, as well as parallelized starting | 136 | starting of services, as well as parallelized starting |
121 | of services.</para> | 137 | of services. See the blog stories linked at the end |
138 | for introduction.</para> | ||
122 | 139 | ||
123 | <para>Note that the daemon software configured for | 140 | <para>Note that the daemon software configured for |
124 | socket activation with socket units needs to be able | 141 | socket activation with socket units needs to be able |
@@ -221,12 +238,23 @@ | |||
221 | of any of these options will have no | 238 | of any of these options will have no |
222 | effect.</para> | 239 | effect.</para> |
223 | 240 | ||
241 | <para>It is also possible to have more | ||
242 | than one socket unit for the same | ||
243 | service when using | ||
244 | <varname>Service=</varname>, and the | ||
245 | service will receive all the sockets | ||
246 | configured in all the socket units. | ||
247 | Sockets configured in one unit are | ||
248 | passed in the order of configuration, | ||
249 | but no ordering between socket units | ||
250 | is specified.</para> | ||
251 | |||
224 | <para>If an IP address is used here, | 252 | <para>If an IP address is used here, |
225 | it is often desirable to listen on it | 253 | it is often desirable to listen on it |
226 | before the interface it is configured | 254 | before the interface it is configured |
227 | on is up and running, and even | 255 | on is up and running, and even |
228 | regardless of whether it will be up and | 256 | regardless of whether it will be up and |
229 | running ever at all. To deal with this | 257 | running at any point. To deal with this |
230 | it is recommended to set the | 258 | it is recommended to set the |
231 | <varname>FreeBind=</varname> option | 259 | <varname>FreeBind=</varname> option |
232 | described below.</para></listitem> | 260 | described below.</para></listitem> |
@@ -687,11 +715,14 @@ | |||
687 | <term><varname>Service=</varname></term> | 715 | <term><varname>Service=</varname></term> |
688 | <listitem><para>Specifies the service | 716 | <listitem><para>Specifies the service |
689 | unit name to activate on incoming | 717 | unit name to activate on incoming |
690 | traffic. This defaults to the service | 718 | traffic. This setting is only allowed |
691 | that bears the same name as the socket | 719 | for sockets with |
692 | (ignoring the different suffixes). In | 720 | <varname>Accept=no</varname>. It |
693 | most cases it should not be necessary | 721 | defaults to the service that bears the |
694 | to use this option.</para></listitem> | 722 | same name as the socket (with the |
723 | suffix replaced). In most cases it | ||
724 | should not be necessary to use this | ||
725 | option.</para></listitem> | ||
695 | </varlistentry> | 726 | </varlistentry> |
696 | 727 | ||
697 | </variablelist> | 728 | </variablelist> |