systemd.socket.xml revision 479fe882ae92e4c2eac3c995cd0d23d4c604889f
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5a58787efeb02a1c3f06569d019ad81fd2efa06end This file is part of systemd.
5a58787efeb02a1c3f06569d019ad81fd2efa06end Copyright 2010 Lennart Poettering
5a58787efeb02a1c3f06569d019ad81fd2efa06end systemd is free software; you can redistribute it and/or modify it
5a58787efeb02a1c3f06569d019ad81fd2efa06end under the terms of the GNU Lesser General Public License as published by
5a58787efeb02a1c3f06569d019ad81fd2efa06end the Free Software Foundation; either version 2.1 of the License, or
5a58787efeb02a1c3f06569d019ad81fd2efa06end (at your option) any later version.
5a58787efeb02a1c3f06569d019ad81fd2efa06end systemd is distributed in the hope that it will be useful, but
5a58787efeb02a1c3f06569d019ad81fd2efa06end WITHOUT ANY WARRANTY; without even the implied warranty of
5a58787efeb02a1c3f06569d019ad81fd2efa06end MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5a58787efeb02a1c3f06569d019ad81fd2efa06end Lesser General Public License for more details.
5a58787efeb02a1c3f06569d019ad81fd2efa06end You should have received a copy of the GNU Lesser General Public License
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd along with systemd; If not, see <http://www.gnu.org/licenses/>.
5a58787efeb02a1c3f06569d019ad81fd2efa06end <refentryinfo>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <authorgroup>
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive </authorgroup>
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive </refentryinfo>
f8396ed8364b56ec8adeaa49cac35a929758a29eslive <refnamediv>
5a58787efeb02a1c3f06569d019ad81fd2efa06end </refnamediv>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <refsynopsisdiv>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <para><filename><replaceable>socket</replaceable>.socket</filename></para>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd </refsynopsisdiv>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <refsect1>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <para>A unit configuration file whose name ends in
117c1f888a14e73cdd821dc6c23eb0411144a41cnd an IPC or network socket or a file system FIFO
117c1f888a14e73cdd821dc6c23eb0411144a41cnd controlled and supervised by systemd, for socket-based
117c1f888a14e73cdd821dc6c23eb0411144a41cnd activation.</para>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <para>This man page lists the configuration options
117c1f888a14e73cdd821dc6c23eb0411144a41cnd specific to this unit type. See
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd for the common options of all unit configuration
117c1f888a14e73cdd821dc6c23eb0411144a41cnd files. The common configuration items are configured
5a58787efeb02a1c3f06569d019ad81fd2efa06end in the generic [Unit] and [Install] sections. The
5a58787efeb02a1c3f06569d019ad81fd2efa06end socket specific configuration options are configured
5a58787efeb02a1c3f06569d019ad81fd2efa06end in the [Socket] section.</para>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <para>Additional options are listed in
5a58787efeb02a1c3f06569d019ad81fd2efa06end <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd which define the execution environment the
5a58787efeb02a1c3f06569d019ad81fd2efa06end in, and in
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive which define the way the processes are
06ba4a61654b3763ad65f52283832ebf058fdf1cslive terminated.</para>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <para>For each socket file a matching service file
97a9a944b5887e91042b019776c41d5dd74557aferikabele <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive for details) must exist, describing the service to
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive start on incoming traffic on the socket. Depending on
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd this must either be named like the socket unit, but
06ba4a61654b3763ad65f52283832ebf058fdf1cslive with the suffix replaced; or it must be a template
06ba4a61654b3763ad65f52283832ebf058fdf1cslive file named the same way. Example: a socket file
92510838f2eb125726e15c5eb4f7a23c7a0396e4slive <option>Accept=true</option> is set a service template
92510838f2eb125726e15c5eb4f7a23c7a0396e4slive file <filename>foo@.service</filename> must exist from
97a9a944b5887e91042b019776c41d5dd74557aferikabele which services are instantiated for each incoming
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive connection.</para>
97a9a944b5887e91042b019776c41d5dd74557aferikabele implicitly have dependencies of type
97a9a944b5887e91042b019776c41d5dd74557aferikabele dependencies of type <varname>Conflicts=</varname> and
92510838f2eb125726e15c5eb4f7a23c7a0396e4slive that socket units pull in basic system
97a9a944b5887e91042b019776c41d5dd74557aferikabele initialization, and are terminated cleanly prior to
92510838f2eb125726e15c5eb4f7a23c7a0396e4slive system shutdown. Only sockets involved with early
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd boot or late system shutdown should disable this
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd option.</para>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <para>Socket units may be used to implement on-demand
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd starting of services, as well as parallelized starting
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd of services.</para>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <para>Note that the daemon software configured for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive socket activation with socket units needs to be able
e8d485701957d5c6de870111c112e168a894d49and to accept sockets from systemd, either via systemd's
e8d485701957d5c6de870111c112e168a894d49and native socket passing interface (see
e8d485701957d5c6de870111c112e168a894d49and <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive for details) or via the traditional
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive <citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>-style
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive socket passing (i.e. sockets passed in via STDIN and
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive in the service file).</para>
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive </refsect1>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <para>Socket files must include a [Socket] section,
5a58787efeb02a1c3f06569d019ad81fd2efa06end which carries information about the socket or FIFO it
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd supervises. A number of options that may be used in
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd this section are shared with other unit types. These
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd options are documented in
5a58787efeb02a1c3f06569d019ad81fd2efa06end <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
string in the format v.w.x.y:z it is
on an address v.w.x.y on a port
(i.e. beginning with /). Behavior
respectively, i.e. the security label
<option>KillMode=</option> in <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
<ulink url="http://0pointer.de/blog/projects/socket-activation2.html">Socket Activation, part II</ulink>,
<ulink url="http://0pointer.de/blog/projects/socket-activated-containers.html">Socket Activated Internet Services and OS Containers</ulink>.