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