]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version='1.0'?> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
eea10b26 | 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
2ca0435b | 5 | |
7f6e8043 | 6 | <refentry id="systemd-socket-activate" |
dfdebb1b | 7 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
2ca0435b ZJS |
8 | |
9 | <refentryinfo> | |
7f6e8043 | 10 | <title>systemd-socket-activate</title> |
2ca0435b | 11 | <productname>systemd</productname> |
2ca0435b ZJS |
12 | </refentryinfo> |
13 | ||
14 | <refmeta> | |
7f6e8043 ZJS |
15 | <refentrytitle>systemd-socket-activate</refentrytitle> |
16 | <manvolnum>1</manvolnum> | |
2ca0435b ZJS |
17 | </refmeta> |
18 | ||
19 | <refnamediv> | |
7f6e8043 | 20 | <refname>systemd-socket-activate</refname> |
2ca0435b ZJS |
21 | <refpurpose>Test socket activation of daemons</refpurpose> |
22 | </refnamediv> | |
23 | ||
24 | <refsynopsisdiv> | |
25 | <cmdsynopsis> | |
7f6e8043 | 26 | <command>systemd-socket-activate</command> |
2ca0435b ZJS |
27 | <arg choice="opt" rep="repeat">OPTIONS</arg> |
28 | <arg choice="plain"><replaceable>daemon</replaceable></arg> | |
29 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
30 | </cmdsynopsis> | |
31 | </refsynopsisdiv> | |
32 | ||
33 | <refsect1> | |
34 | <title>Description</title> | |
35 | ||
3f2d1365 AJ |
36 | <para><command>systemd-socket-activate</command> may be used to launch a socket-activated service program from the |
37 | command line for testing purposes. It may also be used to launch individual instances of the service program per | |
38 | connection. | |
2ca0435b ZJS |
39 | </para> |
40 | ||
ff9b60f3 | 41 | <para>The daemon to launch and its options should be specified |
7f6e8043 | 42 | after options intended for <command>systemd-socket-activate</command>. |
2ca0435b ZJS |
43 | </para> |
44 | ||
eef0a274 LP |
45 | <para>If the <option>--inetd</option> option is given, the socket file descriptor will be used as the standard |
46 | input and output of the launched process. Otherwise, standard input and output will be inherited, and sockets will | |
47 | be passed through file descriptors 3 and higher. Sockets passed through <varname>$LISTEN_FDS</varname> to | |
7f6e8043 | 48 | <command>systemd-socket-activate</command> will be passed through to the daemon, in the original positions. Other sockets |
eef0a274 | 49 | specified with <option>--listen=</option> will use consecutive descriptors. By default, |
7f6e8043 | 50 | <command>systemd-socket-activate</command> listens on a stream socket, use <option>--datagram</option> and |
eef0a274 | 51 | <option>--seqpacket</option> to listen on datagram or sequential packet sockets instead (see below). |
2ca0435b ZJS |
52 | </para> |
53 | </refsect1> | |
54 | ||
55 | <refsect1> | |
56 | <title>Options</title> | |
57 | <variablelist> | |
2ca0435b | 58 | <varlistentry> |
5e65c93a | 59 | <term><option>-l <replaceable>address</replaceable></option></term> |
2ca0435b ZJS |
60 | <term><option>--listen=<replaceable>address</replaceable></option></term> |
61 | ||
62 | <listitem><para>Listen on this <replaceable>address</replaceable>. | |
63 | Takes a string like <literal>2000</literal> or | |
64 | <literal>127.0.0.1:2001</literal>.</para> | |
ec07c3c8 AK |
65 | |
66 | <xi:include href="version-info.xml" xpointer="v230"/> | |
2ca0435b ZJS |
67 | </listitem> |
68 | </varlistentry> | |
69 | ||
70 | <varlistentry> | |
71 | <term><option>-a</option></term> | |
72 | <term><option>--accept</option></term> | |
73 | ||
3f2d1365 | 74 | <listitem><para>Launch an instance of the service program for each connection and pass the connection |
ec07c3c8 AK |
75 | socket.</para> |
76 | ||
77 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
2ca0435b | 78 | </varlistentry> |
5e65c93a | 79 | |
530a071a SS |
80 | <varlistentry> |
81 | <term><option>-d</option></term> | |
82 | <term><option>--datagram</option></term> | |
83 | ||
d31e430f | 84 | <listitem><para>Listen on a datagram socket (<constant>SOCK_DGRAM</constant>), instead of a stream socket |
ec07c3c8 AK |
85 | (<constant>SOCK_STREAM</constant>). May not be combined with <option>--seqpacket</option>.</para> |
86 | ||
87 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
d31e430f LP |
88 | </varlistentry> |
89 | ||
90 | <varlistentry> | |
91 | <term><option>--seqpacket</option></term> | |
92 | ||
93 | <listitem><para>Listen on a sequential packet socket (<constant>SOCK_SEQPACKET</constant>), instead of a stream | |
94 | socket (<constant>SOCK_STREAM</constant>). May not be combined with | |
ec07c3c8 AK |
95 | <option>--datagram</option>.</para> |
96 | ||
97 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
530a071a SS |
98 | </varlistentry> |
99 | ||
eef0a274 LP |
100 | <varlistentry> |
101 | <term><option>--inetd</option></term> | |
102 | ||
103 | <listitem><para>Use the inetd protocol for passing file descriptors, i.e. as standard input and standard | |
104 | output, instead of the new-style protocol for passing file descriptors using <varname>$LISTEN_FDS</varname> | |
ec07c3c8 AK |
105 | (see above).</para> |
106 | ||
107 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
eef0a274 LP |
108 | </varlistentry> |
109 | ||
5e65c93a ZJS |
110 | <varlistentry> |
111 | <term><option>-E <replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term> | |
892213bf | 112 | <term><option>--setenv=<replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term> |
5e65c93a ZJS |
113 | |
114 | <listitem><para>Add this variable to the environment of the | |
115 | launched process. If <replaceable>VAR</replaceable> is | |
79640424 JE |
116 | followed by <literal>=</literal>, assume that it is a |
117 | variable–value pair. Otherwise, obtain the value from the | |
7f6e8043 | 118 | environment of <command>systemd-socket-activate</command> itself. |
ec07c3c8 AK |
119 | </para> |
120 | ||
121 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
5e65c93a | 122 | </varlistentry> |
dfdebb1b | 123 | |
8dd4c05b | 124 | <varlistentry> |
9bfabe14 | 125 | <term><option>--fdname=<replaceable>NAME</replaceable><optional>:<replaceable>NAME</replaceable>…</optional></option></term> |
cf98937c ZJS |
126 | |
127 | <listitem><para>Specify names for the file descriptors passed. This is equivalent to setting | |
128 | <varname>FileDescriptorName=</varname> in socket unit files, and enables use of | |
129 | <citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>. | |
130 | Multiple entries may be specifies using separate options or by separating names with colons | |
b17649ee | 131 | (<literal>:</literal>) in one option. In case more names are given than descriptors, superfluous ones will be |
cf98937c | 132 | ignored. In case less names are given than descriptors, the remaining file descriptors will be unnamed. |
ec07c3c8 AK |
133 | </para> |
134 | ||
aefdc112 | 135 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> |
8dd4c05b LP |
136 | </varlistentry> |
137 | ||
dfdebb1b ZJS |
138 | <xi:include href="standard-options.xml" xpointer="help" /> |
139 | <xi:include href="standard-options.xml" xpointer="version" /> | |
2ca0435b ZJS |
140 | </variablelist> |
141 | </refsect1> | |
142 | ||
143 | <refsect1> | |
144 | <title>Environment variables</title> | |
145 | <variablelist class='environment-variables'> | |
146 | <varlistentry> | |
147 | <term><varname>$LISTEN_FDS</varname></term> | |
148 | <term><varname>$LISTEN_PID</varname></term> | |
8dd4c05b | 149 | <term><varname>$LISTEN_FDNAMES</varname></term> |
2ca0435b | 150 | |
1446560f | 151 | <listitem><para>See |
ec07c3c8 AK |
152 | <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para> |
153 | ||
154 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
2ca0435b ZJS |
155 | </varlistentry> |
156 | ||
157 | <varlistentry> | |
158 | <term><varname>$SYSTEMD_LOG_TARGET</varname></term> | |
159 | <term><varname>$SYSTEMD_LOG_LEVEL</varname></term> | |
c5673ed0 | 160 | <term><varname>$SYSTEMD_LOG_TIME</varname></term> |
2ca0435b ZJS |
161 | <term><varname>$SYSTEMD_LOG_COLOR</varname></term> |
162 | <term><varname>$SYSTEMD_LOG_LOCATION</varname></term> | |
163 | ||
1446560f | 164 | <listitem><para>Same as in |
aefdc112 AK |
165 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para> |
166 | ||
167 | <xi:include href="version-info.xml" xpointer="v230"/></listitem> | |
2ca0435b ZJS |
168 | </varlistentry> |
169 | </variablelist> | |
170 | </refsect1> | |
171 | ||
172 | <refsect1> | |
1db8c66f | 173 | <title>Examples</title> |
2ca0435b | 174 | |
1db8c66f RC |
175 | <example> |
176 | <title>Run an echo server on port 2000</title> | |
2ca0435b | 177 | |
7f6e8043 | 178 | <programlisting>$ systemd-socket-activate -l 2000 --inetd -a cat</programlisting> |
1db8c66f | 179 | </example> |
2ca0435b | 180 | |
1db8c66f | 181 | <example> |
b938cb90 | 182 | <title>Run a socket-activated instance of <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry></title> |
2ca0435b | 183 | |
7f6e8043 | 184 | <programlisting>$ systemd-socket-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting> |
1db8c66f | 185 | </example> |
2ca0435b ZJS |
186 | </refsect1> |
187 | ||
188 | <refsect1> | |
189 | <title>See Also</title> | |
13a69c12 DT |
190 | <para><simplelist type="inline"> |
191 | <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
192 | <member><citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
193 | <member><citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
194 | <member><citerefentry><refentrytitle>systemd-run</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
195 | <member><citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> | |
196 | <member><citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> | |
197 | <member><citerefentry project='man-pages'><refentrytitle>cat</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
198 | </simplelist></para> | |
2ca0435b ZJS |
199 | </refsect1> |
200 | </refentry> |