chiark / gitweb /
f1e7d408ab04b809a94ea3689ddde7340c06603f
[elogind.git] / man / systemd.socket.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU Lesser General Public License as published by
13   the Free Software Foundation; either version 2.1 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="systemd.socket">
26         <refentryinfo>
27                 <title>systemd.socket</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd.socket</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.socket</refname>
47                 <refpurpose>Socket unit configuration</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename><replaceable>socket</replaceable>.socket</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <filename>.socket</filename> encodes information about
59                 an IPC or network socket or a file system FIFO
60                 controlled and supervised by systemd, for socket-based
61                 activation.</para>
62
63                 <para>This man page lists the configuration options
64                 specific to this unit type. See
65                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
66                 for the common options of all unit configuration
67                 files. The common configuration items are configured
68                 in the generic [Unit] and [Install] sections. The
69                 socket specific configuration options are configured
70                 in the [Socket] section.</para>
71
72                 <para>Additional options are listed in
73                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
74                 which define the execution environment the
75                 <option>ExecStartPre=</option>,
76                 <option>ExecStartPost=</option>,
77                 <option>ExecStopPre=</option> and
78                 <option>ExecStopPost=</option> commands are executed
79                 in, and in
80                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
81                 which define the way the processes are
82                 terminated.</para>
83
84                 <para>For each socket file a matching service file
85                 (see
86                 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
87                 for details) must exist, describing the service to
88                 start on incoming traffic on the socket. Depending on
89                 the setting of <option>Accept=</option> (see below),
90                 this must either be named like the socket unit, but
91                 with the suffix replaced; or it must be a template
92                 file named the same way. Example: a socket file
93                 <filename>foo.socket</filename> needs a matching
94                 service <filename>foo.service</filename> if
95                 <option>Accept=false</option> is set. If
96                 <option>Accept=true</option> is set a service template
97                 file <filename>foo@.service</filename> must exist from
98                 which services are instantiated for each incoming
99                 connection.</para>
100
101                 <para>Unless <varname>DefaultDependencies=</varname>
102                 is set to <option>false</option>, socket units will
103                 implicitly have dependencies of type
104                 <varname>Requires=</varname> and
105                 <varname>After=</varname> on
106                 <filename>sysinit.target</filename> as well as
107                 dependencies of type <varname>Conflicts=</varname> and
108                 <varname>Before=</varname> on
109                 <filename>shutdown.target</filename>. These ensure
110                 that socket units pull in basic system
111                 initialization, and are terminated cleanly prior to
112                 system shutdown. Only sockets involved with early
113                 boot or late system shutdown should disable this
114                 option.</para>
115
116                 <para>Socket units may be used to implement on-demand
117                 starting of services, as well as parallelized starting
118                 of services.</para>
119
120                 <para>Note that the daemon software configured for
121                 socket activation with socket units needs to be able
122                 to accept sockets from systemd, either via systemd's
123                 native socket passing interface (see
124                 <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
125                 for details) or via the traditional
126                 <citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>-style
127                 socket passing (i.e. sockets passed in via STDIN and
128                 STDOUT, using <varname>StandardInput=socket</varname>
129                 in the service file).</para>
130         </refsect1>
131
132         <refsect1>
133                 <title>Options</title>
134
135                 <para>Socket files must include a [Socket] section,
136                 which carries information about the socket or FIFO it
137                 supervises. A number of options that may be used in
138                 this section are shared with other unit types. These
139                 options are documented in
140                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
141                 and
142                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
143                 options specific to the [Socket] section of socket
144                 units are the following:</para>
145
146                 <variablelist class='unit-directives'>
147                         <varlistentry>
148                                 <term><varname>ListenStream=</varname></term>
149                                 <term><varname>ListenDatagram=</varname></term>
150                                 <term><varname>ListenSequentialPacket=</varname></term>
151                                 <listitem><para>Specifies an address
152                                 to listen on for a stream
153                                 (SOCK_STREAM), datagram (SOCK_DGRAM),
154                                 or sequential packet
155                                 (SOCK_SEQPACKET) socket, respectively. The address
156                                 can be written in various formats:</para>
157
158                                 <para>If the address starts with a
159                                 slash (/), it is read as file system
160                                 socket in the AF_UNIX socket
161                                 family.</para>
162
163                                 <para>If the address starts with an
164                                 at symbol (@) it is read as abstract
165                                 namespace socket in the AF_UNIX
166                                 family. The @ is replaced with a NUL
167                                 character before binding. For details
168                                 see
169                                 <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
170
171                                 <para>If the address string is a
172                                 single number it is read as port
173                                 number to listen on via
174                                 IPv6. Depending on the value of
175                                 <varname>BindIPv6Only=</varname> (see below) this
176                                 might result in the service being
177                                 available via both IPv6 and IPv4 (default) or
178                                 just via IPv6.
179                                 </para>
180
181                                 <para>If the address string is a
182                                 string in the format v.w.x.y:z it is
183                                 read as IPv4 specifier for listening
184                                 on an address v.w.x.y on a port
185                                 z.</para>
186
187                                 <para>If the address string is a
188                                 string in the format [x]:y it is read
189                                 as IPv6 address x on a port y. Note
190                                 that this might make the service
191                                 available via IPv4, too, depending on
192                                 the <varname>BindIPv6Only=</varname>
193                                 setting (see below).
194                                 </para>
195
196                                 <para>Note that SOCK_SEQPACKET
197                                 (i.e. <varname>ListenSequentialPacket=</varname>)
198                                 is only available for AF_UNIX
199                                 sockets. SOCK_STREAM
200                                 (i.e. <varname>ListenStream=</varname>)
201                                 when used for IP sockets refers to TCP
202                                 sockets, SOCK_DGRAM
203                                 (i.e. <varname>ListenDatagram=</varname>)
204                                 to UDP.</para>
205
206                                 <para>These options may be specified
207                                 more than once in which case incoming
208                                 traffic on any of the sockets will
209                                 trigger service activation, and all
210                                 listed sockets will be passed to the
211                                 service, regardless whether there is
212                                 incoming traffic on them or not. If
213                                 the empty string is assigned to any of
214                                 these options, the list of addresses
215                                 to listen on is reset, all prior uses
216                                 of any of these options will have no
217                                 effect.</para>
218
219                                 <para>If an IP address is used here,
220                                 it is often desirable to listen on it
221                                 before the interface it is configured
222                                 on is up and running, and even
223                                 regardless whether it will be up and
224                                 running ever at all. To deal with this
225                                 it is recommended to set the
226                                 <varname>FreeBind=</varname> option
227                                 described below.</para></listitem>
228                         </varlistentry>
229
230                         <varlistentry>
231                                 <term><varname>ListenFIFO=</varname></term>
232                                 <listitem><para>Specifies a file
233                                 system FIFO to listen on. This expects
234                                 an absolute file system path as
235                                 argument. Behavior otherwise is very
236                                 similar to the
237                                 <varname>ListenDatagram=</varname>
238                                 directive above.</para></listitem>
239                         </varlistentry>
240
241                         <varlistentry>
242                                 <term><varname>ListenSpecial=</varname></term>
243                                 <listitem><para>Specifies a special
244                                 file in the file system to listen
245                                 on. This expects an absolute file
246                                 system path as argument. Behavior
247                                 otherwise is very similar to the
248                                 <varname>ListenFIFO=</varname>
249                                 directive above. Use this to open
250                                 character device nodes as well as
251                                 special files in
252                                 <filename>/proc</filename> and
253                                 <filename>/sys</filename>.</para></listitem>
254                         </varlistentry>
255
256                         <varlistentry>
257                                 <term><varname>ListenNetlink=</varname></term>
258                                 <listitem><para>Specifies a Netlink
259                                 family to create a socket for to
260                                 listen on. This expects a short string
261                                 referring to the AF_NETLINK family
262                                 name (such as <varname>audit</varname>
263                                 or <varname>kobject-uevent</varname>)
264                                 as argument, optionally suffixed by a
265                                 whitespace followed by a multicast
266                                 group integer. Behavior otherwise is
267                                 very similar to the
268                                 <varname>ListenDatagram=</varname>
269                                 directive above.</para></listitem>
270                         </varlistentry>
271
272                         <varlistentry>
273                                 <term><varname>ListenMessageQueue=</varname></term>
274                                 <listitem><para>Specifies a POSIX
275                                 message queue name to listen on. This
276                                 expects a valid message queue name
277                                 (i.e. beginning with /). Behavior
278                                 otherwise is very similar to the
279                                 <varname>ListenFIFO=</varname>
280                                 directive above. On Linux message
281                                 queue descriptors are actually file
282                                 descriptors and can be inherited
283                                 between processes.</para></listitem>
284                         </varlistentry>
285
286                         <varlistentry>
287                                 <term><varname>BindIPv6Only=</varname></term>
288                                 <listitem><para>Takes a one of
289                                 <option>default</option>,
290                                 <option>both</option> or
291                                 <option>ipv6-only</option>. Controls
292                                 the IPV6_V6ONLY socket option (see
293                                 <citerefentry><refentrytitle>ipv6</refentrytitle><manvolnum>7</manvolnum></citerefentry>
294                                 for details). If
295                                 <option>both</option>, IPv6 sockets
296                                 bound will be accessible via both IPv4
297                                 and IPv6. If
298                                 <option>ipv6-only</option>, they will
299                                 be accessible via IPv6 only. If
300                                 <option>default</option> (which is the
301                                 default, surprise!) the system wide
302                                 default setting is used, as controlled
303                                 by
304                                 <filename>/proc/sys/net/ipv6/bindv6only</filename>,
305                                 which in turn defaults to the
306                                 equivalent of
307                                 <option>both</option>.</para>
308                                 </listitem>
309                         </varlistentry>
310
311                         <varlistentry>
312                                 <term><varname>Backlog=</varname></term>
313                                 <listitem><para>Takes an unsigned
314                                 integer argument. Specifies the number
315                                 of connections to queue that have not
316                                 been accepted yet. This setting
317                                 matters only for stream and sequential
318                                 packet sockets. See
319                                 <citerefentry><refentrytitle>listen</refentrytitle><manvolnum>2</manvolnum></citerefentry>
320                                 for details. Defaults to SOMAXCONN
321                                 (128).</para></listitem>
322                         </varlistentry>
323
324                         <varlistentry>
325                                 <term><varname>BindToDevice=</varname></term>
326                                 <listitem><para>Specifies a network
327                                 interface name to bind this socket
328                                 to. If set traffic will only be
329                                 accepted from the specified network
330                                 interfaces. This controls the
331                                 SO_BINDTODEVICE socket option (see
332                                 <citerefentry><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry>
333                                 for details). If this option is used,
334                                 an automatic dependency from this
335                                 socket unit on the network interface
336                                 device unit
337                                 (<citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
338                                 is created.</para></listitem>
339                         </varlistentry>
340
341                         <varlistentry>
342                                 <term><varname>DirectoryMode=</varname></term>
343                                 <listitem><para>If listening on a file
344                                 system socket or FIFO, the parent
345                                 directories are automatically created
346                                 if needed. This option specifies the
347                                 file system access mode used when
348                                 creating these directories. Takes an
349                                 access mode in octal
350                                 notation. Defaults to
351                                 0755.</para></listitem>
352                         </varlistentry>
353
354                         <varlistentry>
355                                 <term><varname>SocketMode=</varname></term>
356                                 <listitem><para>If listening on a file
357                                 system socket or FIFO, this option
358                                 specifies the file system access mode
359                                 used when creating the file
360                                 node. Takes an access mode in octal
361                                 notation. Defaults to
362                                 0666.</para></listitem>
363                         </varlistentry>
364
365                         <varlistentry>
366                                 <term><varname>Accept=</varname></term>
367                                 <listitem><para>Takes a boolean
368                                 argument. If true, a service instance
369                                 is spawned for each incoming
370                                 connection and only the connection
371                                 socket is passed to it. If false, all
372                                 listening sockets themselves are
373                                 passed to the started service unit,
374                                 and only one service unit is spawned
375                                 for all connections (also see
376                                 above). This value is ignored for
377                                 datagram sockets and FIFOs where
378                                 a single service unit unconditionally
379                                 handles all incoming traffic. Defaults
380                                 to <option>false</option>. For
381                                 performance reasons, it is recommended
382                                 to write new daemons only in a way
383                                 that is suitable for
384                                 <option>Accept=false</option>. A daemon
385                                 listening on an AF_UNIX socket may, but does not need to, call
386                                 <citerefentry><refentrytitle>close</refentrytitle><manvolnum>2</manvolnum></citerefentry>
387                                 or
388                                 <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>2</manvolnum></citerefentry>
389                                 on the received socket before exiting. However,
390                                 it must not unlink the socket from a
391                                 filesystem. This option is mostly useful
392                                 to allow daemons designed for usage with
393                                 <citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
394                                 to work unmodified with systemd socket
395                                 activation.</para></listitem>
396                         </varlistentry>
397
398                         <varlistentry>
399                                 <term><varname>MaxConnections=</varname></term>
400                                 <listitem><para>The maximum number of
401                                 connections to simultaneously run
402                                 services instances for, when
403                                 <option>Accept=true</option> is
404                                 set. If more concurrent connections
405                                 are coming in, they will be refused
406                                 until at least one existing connection
407                                 is terminated. This setting has no
408                                 effect for sockets configured with
409                                 <option>Accept=false</option> or datagram
410                                 sockets. Defaults to
411                                 64.</para></listitem>
412                         </varlistentry>
413
414                         <varlistentry>
415                                 <term><varname>KeepAlive=</varname></term>
416                                 <listitem><para>Takes a boolean
417                                 argument. If true, the TCP/IP stack
418                                 will send a keep alive message after
419                                 2h (depending on the configuration of
420                                 <filename>/proc/sys/net/ipv4/tcp_keepalive_time</filename>)
421                                 for all TCP streams accepted on this
422                                 socket. This controls the SO_KEEPALIVE
423                                 socket option (see
424                                 <citerefentry><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry>
425                                 and the <ulink
426                                 url="http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/">TCP
427                                 Keepalive HOWTO</ulink> for details.)
428                                 Defaults to
429                                 <option>false</option>.</para></listitem>
430                         </varlistentry>
431
432                         <varlistentry>
433                                 <term><varname>Priority=</varname></term>
434                                 <listitem><para>Takes an integer
435                                 argument controlling the priority for
436                                 all traffic sent from this
437                                 socket. This controls the SO_PRIORITY
438                                 socket option (see
439                                 <citerefentry><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry>
440                                 for details.).</para></listitem>
441                         </varlistentry>
442
443                         <varlistentry>
444                                 <term><varname>ReceiveBuffer=</varname></term>
445                                 <term><varname>SendBuffer=</varname></term>
446                                 <listitem><para>Takes an integer
447                                 argument controlling the receive
448                                 or send buffer sizes of this
449                                 socket, respectively. This controls the SO_RCVBUF
450                                 and SO_SNDBUF socket options (see
451                                 <citerefentry><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry>
452                                 for details.).</para></listitem>
453                         </varlistentry>
454
455                         <varlistentry>
456                                 <term><varname>IPTOS=</varname></term>
457                                 <listitem><para>Takes an integer
458                                 argument controlling the IP
459                                 Type-Of-Service field for packets
460                                 generated from this socket. This
461                                 controls the IP_TOS socket option (see
462                                 <citerefentry><refentrytitle>ip</refentrytitle><manvolnum>7</manvolnum></citerefentry>
463                                 for details.). Either a numeric string
464                                 or one of <option>low-delay</option>,
465                                 <option>throughput</option>,
466                                 <option>reliability</option> or
467                                 <option>low-cost</option> may be
468                                 specified.</para></listitem>
469                         </varlistentry>
470
471                         <varlistentry>
472                                 <term><varname>IPTTL=</varname></term>
473                                 <listitem><para>Takes an integer
474                                 argument controlling the IPv4
475                                 Time-To-Live/IPv6 Hop-Count field for
476                                 packets generated from this
477                                 socket. This sets the
478                                 IP_TTL/IPV6_UNICAST_HOPS socket
479                                 options (see
480                                 <citerefentry><refentrytitle>ip</refentrytitle><manvolnum>7</manvolnum></citerefentry>
481                                 and
482                                 <citerefentry><refentrytitle>ipv6</refentrytitle><manvolnum>7</manvolnum></citerefentry>
483                                 for details.)</para></listitem>
484                         </varlistentry>
485
486                         <varlistentry>
487                                 <term><varname>Mark=</varname></term>
488                                 <listitem><para>Takes an integer
489                                 value. Controls the firewall mark of
490                                 packets generated by this socket. This
491                                 can be used in the firewall logic to
492                                 filter packets from this socket. This
493                                 sets the SO_MARK socket option. See
494                                 <citerefentry><refentrytitle>iptables</refentrytitle><manvolnum>8</manvolnum></citerefentry>
495                                 for details.</para></listitem>
496                         </varlistentry>
497
498                         <varlistentry>
499                                 <term><varname>SmackLabel=</varname></term>
500                                 <term><varname>SmackLabelIPIn=</varname></term>
501                                 <term><varname>SmackLabelIPOut=</varname></term>
502                                 <listitem><para>Takes a string
503                                 value. Controls the extended
504                                 attributes
505                                 <literal>security.SMACK64</literal>,
506                                 <literal>security.SMACK64IPIN</literal>
507                                 and
508                                 <literal>security.SMACK64IPOUT</literal>,
509                                 respectively, i.e. the security label
510                                 of the FIFO, or the security label for
511                                 the incoming or outgoing connections
512                                 of the socket, respectively.  See
513                                 <ulink
514                                 url="https://www.kernel.org/doc/Documentation/security/Smack.txt">Smack.txt</ulink>
515                                 for details.</para></listitem>
516                         </varlistentry>
517
518                         <varlistentry>
519                                 <term><varname>PipeSize=</varname></term>
520                                 <listitem><para>Takes an integer
521                                 value. Controls the pipe buffer size
522                                 of FIFOs configured in this socket
523                                 unit.  See
524                                 <citerefentry><refentrytitle>fcntl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
525                                 for details.</para></listitem>
526                         </varlistentry>
527
528                         <varlistentry>
529                                 <term><varname>MessageQueueMaxMessages=</varname>,
530                                 <varname>MessageQueueMessageSize=</varname></term>
531                                 <listitem><para>These two settings
532                                 take integer values and control the
533                                 mq_maxmsg field or the mq_msgsize field, respectively, when
534                                 creating the message queue. Note that
535                                 either none or both of these variables
536                                 need to be set. See
537                                 <citerefentry><refentrytitle>mq_setattr</refentrytitle><manvolnum>3</manvolnum></citerefentry>
538                                 for details.</para></listitem>
539                         </varlistentry>
540
541                         <varlistentry>
542                                 <term><varname>FreeBind=</varname></term>
543                                 <listitem><para>Takes a boolean
544                                 value. Controls whether the socket can
545                                 be bound to non-local IP
546                                 addresses. This is useful to configure
547                                 sockets listening on specific IP
548                                 addresses before those IP addresses
549                                 are successfully configured on a
550                                 network interface. This sets the
551                                 IP_FREEBIND socket option. For
552                                 robustness reasons it is recommended
553                                 to use this option whenever you bind a
554                                 socket to a specific IP
555                                 address. Defaults to <option>false</option>.</para></listitem>
556                         </varlistentry>
557
558                         <varlistentry>
559                                 <term><varname>Transparent=</varname></term>
560                                 <listitem><para>Takes a boolean
561                                 value. Controls the IP_TRANSPARENT
562                                 socket option. Defaults to
563                                 <option>false</option>.</para></listitem>
564                         </varlistentry>
565
566                         <varlistentry>
567                                 <term><varname>Broadcast=</varname></term>
568                                 <listitem><para>Takes a boolean
569                                 value. This controls the SO_BROADCAST
570                                 socket option, which allows broadcast
571                                 datagrams to be sent from this
572                                 socket. Defaults to
573                                 <option>false</option>.</para></listitem>
574                         </varlistentry>
575
576                         <varlistentry>
577                                 <term><varname>PassCredentials=</varname></term>
578                                 <listitem><para>Takes a boolean
579                                 value. This controls the SO_PASSCRED
580                                 socket option, which allows AF_UNIX sockets to
581                                 receive the credentials of the sending
582                                 process in an ancillary message.
583                                 Defaults to
584                                 <option>false</option>.</para></listitem>
585                         </varlistentry>
586
587                         <varlistentry>
588                                 <term><varname>PassSecurity=</varname></term>
589                                 <listitem><para>Takes a boolean
590                                 value. This controls the SO_PASSSEC
591                                 socket option, which allows AF_UNIX
592                                 sockets to receive the security
593                                 context of the sending process in an
594                                 ancillary message.  Defaults to
595                                 <option>false</option>.</para></listitem>
596                         </varlistentry>
597
598                         <varlistentry>
599                                 <term><varname>TCPCongestion=</varname></term>
600                                 <listitem><para>Takes a string
601                                 value. Controls the TCP congestion
602                                 algorithm used by this socket. Should
603                                 be one of "westwood", "veno", "cubic",
604                                 "lp" or any other available algorithm
605                                 supported by the IP stack. This
606                                 setting applies only to stream
607                                 sockets.</para></listitem>
608                         </varlistentry>
609
610                         <varlistentry>
611                                 <term><varname>ExecStartPre=</varname></term>
612                                 <term><varname>ExecStartPost=</varname></term>
613                                 <listitem><para>Takes one or more
614                                 command lines, which are executed
615                                 before or after the listening
616                                 sockets/FIFOs are created and
617                                 bound, respectively. The first token of the command
618                                 line must be an absolute file name,
619                                 then followed by arguments for the
620                                 process. Multiple command lines may be
621                                 specified following the same scheme as
622                                 used for
623                                 <varname>ExecStartPre=</varname> of
624                                 service unit files.</para></listitem>
625                         </varlistentry>
626
627                         <varlistentry>
628                                 <term><varname>ExecStopPre=</varname></term>
629                                 <term><varname>ExecStopPost=</varname></term>
630                                 <listitem><para>Additional commands
631                                 that are executed before or after
632                                 the listening sockets/FIFOs are closed
633                                 and removed, respectively. Multiple command lines
634                                 may be specified following the same
635                                 scheme as used for
636                                 <varname>ExecStartPre=</varname> of
637                                 service unit files.</para></listitem>
638                         </varlistentry>
639
640                         <varlistentry>
641                                 <term><varname>TimeoutSec=</varname></term>
642                                 <listitem><para>Configures the time to
643                                 wait for the commands specified in
644                                 <varname>ExecStartPre=</varname>,
645                                 <varname>ExecStartPost=</varname>,
646                                 <varname>ExecStopPre=</varname> and
647                                 <varname>ExecStopPost=</varname> to
648                                 finish. If a command does not exit
649                                 within the configured time, the socket
650                                 will be considered failed and be shut
651                                 down again. All commands still running,
652                                 will be terminated forcibly via
653                                 SIGTERM, and after another delay of
654                                 this time with SIGKILL. (See
655                                 <option>KillMode=</option> in <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
656                                 Takes a unit-less value in seconds, or
657                                 a time span value such as "5min
658                                 20s". Pass 0 to disable the timeout
659                                 logic. Defaults to
660                                 90s.</para></listitem>
661                         </varlistentry>
662
663                         <varlistentry>
664                                 <term><varname>Service=</varname></term>
665                                 <listitem><para>Specifies the service
666                                 unit name to activate on incoming
667                                 traffic. This defaults to the service
668                                 that bears the same name as the socket
669                                 (ignoring the different suffixes). In
670                                 most cases it should not be necessary
671                                 to use this option.</para></listitem>
672                         </varlistentry>
673
674                 </variablelist>
675
676                 <para>Check
677                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
678                 and
679                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
680                 for more settings.</para>
681
682         </refsect1>
683
684         <refsect1>
685                   <title>See Also</title>
686                   <para>
687                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
688                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
689                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
690                           <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
691                           <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
692                           <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
693                           <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
694                   </para>
695
696                   <para>
697                           For more extensive descriptions see the "Systemd for Developers" series:
698                           <ulink url="http://0pointer.de/blog/projects/socket-activation.html">Socket Activation</ulink>,
699                           <ulink url="http://0pointer.de/blog/projects/socket-activation2.html">Socket Activation, part II</ulink>,
700                           <ulink url="http://0pointer.de/blog/projects/inetd.html">Converting inetd Services</ulink>,
701                           <ulink url="http://0pointer.de/blog/projects/socket-activated-containers.html">Socket Activated Internet Services and OS Containers</ulink>.
702                   </para>
703         </refsect1>
704
705 </refentry>