]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-activate.xml
Merge pull request #288 from phomes/cgroup-util
[thirdparty/systemd.git] / man / systemd-activate.xml
CommitLineData
3802a3d3 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2ca0435b 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
681eb9cf
FB
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
2ca0435b
ZJS
7
8<!--
b975b0d5 9 This file is part of systemd.
2ca0435b 10
b975b0d5 11 Copyright 2013 Zbigniew Jędrzejewski-Szmek
2ca0435b 12
b975b0d5
ZJS
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
2ca0435b 17
b975b0d5
ZJS
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
2ca0435b 22
b975b0d5
ZJS
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
2ca0435b
ZJS
25-->
26
dfdebb1b
ZJS
27<refentry id="systemd-activate"
28 xmlns:xi="http://www.w3.org/2001/XInclude">
2ca0435b
ZJS
29
30 <refentryinfo>
31 <title>systemd-activate</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>Developer</contrib>
37 <firstname>Zbigniew</firstname>
38 <surname>Jędrzejewski-Szmek</surname>
39 <email>zbyszek@in.waw.pl</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>systemd-activate</refentrytitle>
46 <manvolnum>8</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>systemd-activate</refname>
51 <refpurpose>Test socket activation of daemons</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <cmdsynopsis>
681eb9cf 56 <command>&rootlibexecdir;/systemd-activate</command>
2ca0435b
ZJS
57 <arg choice="opt" rep="repeat">OPTIONS</arg>
58 <arg choice="plain"><replaceable>daemon</replaceable></arg>
59 <arg choice="opt" rep="repeat">OPTIONS</arg>
60 </cmdsynopsis>
61 </refsynopsisdiv>
62
63 <refsect1>
64 <title>Description</title>
65
66 <para><command>systemd-activate</command> can be used to
81c7dd89 67 launch a socket activated daemon from the command line for
2ca0435b
ZJS
68 testing purposes. It can also be used to launch single instances
69 of the daemon per connection (inetd-style).
70 </para>
71
ff9b60f3 72 <para>The daemon to launch and its options should be specified
2ca0435b
ZJS
73 after options intended for <command>systemd-activate</command>.
74 </para>
75
76 <para>If the <option>-a</option> option is given, file descriptor
77 of the connection will be used as the standard input and output of
78 the launched process. Otherwise, standard input and output will be
79 inherited, and sockets will be passed through file descriptors 3
80 and higher. Sockets passed through <varname>$LISTEN_FDS</varname>
81 to <command>systemd-activate</command> will be passed through to
ff9b60f3 82 the daemon, in the original positions. Other sockets specified
2ca0435b
ZJS
83 with <option>--listen</option> will use consecutive descriptors.
84 </para>
85 </refsect1>
86
87 <refsect1>
88 <title>Options</title>
89 <variablelist>
2ca0435b 90 <varlistentry>
5e65c93a 91 <term><option>-l <replaceable>address</replaceable></option></term>
2ca0435b
ZJS
92 <term><option>--listen=<replaceable>address</replaceable></option></term>
93
94 <listitem><para>Listen on this <replaceable>address</replaceable>.
95 Takes a string like <literal>2000</literal> or
96 <literal>127.0.0.1:2001</literal>.</para>
97 </listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><option>-a</option></term>
102 <term><option>--accept</option></term>
103
104 <listitem><para>Launch a separate instance of daemon per
105 connection and pass the connection socket as standard input
106 and standard output.</para></listitem>
107 </varlistentry>
5e65c93a
ZJS
108
109 <varlistentry>
110 <term><option>-E <replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term>
892213bf 111 <term><option>--setenv=<replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term>
5e65c93a
ZJS
112
113 <listitem><para>Add this variable to the environment of the
114 launched process. If <replaceable>VAR</replaceable> is
79640424
JE
115 followed by <literal>=</literal>, assume that it is a
116 variable–value pair. Otherwise, obtain the value from the
5e65c93a
ZJS
117 environment of <command>systemd-activate</command> itself.
118 </para></listitem>
119 </varlistentry>
dfdebb1b
ZJS
120
121 <xi:include href="standard-options.xml" xpointer="help" />
122 <xi:include href="standard-options.xml" xpointer="version" />
2ca0435b
ZJS
123 </variablelist>
124 </refsect1>
125
126 <refsect1>
127 <title>Environment variables</title>
128 <variablelist class='environment-variables'>
129 <varlistentry>
130 <term><varname>$LISTEN_FDS</varname></term>
131 <term><varname>$LISTEN_PID</varname></term>
132
1446560f
ZJS
133 <listitem><para>See
134 <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
2ca0435b
ZJS
135 </varlistentry>
136
137 <varlistentry>
138 <term><varname>$SYSTEMD_LOG_TARGET</varname></term>
139 <term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
140 <term><varname>$SYSTEMD_LOG_COLOR</varname></term>
141 <term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
142
1446560f
ZJS
143 <listitem><para>Same as in
144 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para></listitem>
2ca0435b
ZJS
145 </varlistentry>
146 </variablelist>
147 </refsect1>
148
149 <refsect1>
1db8c66f 150 <title>Examples</title>
2ca0435b 151
1db8c66f
RC
152 <example>
153 <title>Run an echo server on port 2000</title>
2ca0435b 154
681eb9cf 155 <programlisting>$ &rootlibexecdir;/systemd-activate -l 2000 -a cat</programlisting>
1db8c66f 156 </example>
2ca0435b 157
1db8c66f
RC
158 <example>
159 <title>Run a socket activated instance of <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
2ca0435b 160
681eb9cf 161 <programlisting>$ &rootlibexecdir;/systemd-activate -l 19531 &rootlibexecdir;/systemd-journal-gatewayd</programlisting>
1db8c66f 162 </example>
2ca0435b
ZJS
163 </refsect1>
164
165 <refsect1>
166 <title>See Also</title>
167 <para>
168 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
169 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
170 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
3ba3a79d 171 <citerefentry project='man-pages'><refentrytitle>cat</refentrytitle><manvolnum>1</manvolnum></citerefentry>
2ca0435b
ZJS
172 </para>
173 </refsect1>
174</refentry>