]> git.proxmox.com Git - mirror_lxc.git/blame - doc/lxc-execute.sgml.in
Merge pull request #2100 from lifeng68/Modify_git_ignore
[mirror_lxc.git] / doc / lxc-execute.sgml.in
CommitLineData
f79d43bb 1<!--
d823d5b9 2
3lxc: linux Container library
4
5(C) Copyright IBM Corp. 2007, 2008
6
7Authors:
9afe19d6 8Daniel Lezcano <daniel.lezcano at free.fr>
d823d5b9 9
10This library is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2.1 of the License, or (at your option) any later version.
14
15This library is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public
21License along with this library; if not, write to the Free Software
250b1eec 22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d823d5b9 23
24-->
25
7f951458 26<!DOCTYPE refentry PUBLIC @docdtd@ [
99e4008c 27
10fba81b 28<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
99e4008c
MN
29<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
30]>
d823d5b9 31
32<refentry>
33
34 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
35
36 <refmeta>
37 <refentrytitle>lxc-execute</refentrytitle>
38 <manvolnum>1</manvolnum>
39 </refmeta>
40
41 <refnamediv>
42 <refname>lxc-execute</refname>
43
44 <refpurpose>
45 run an application inside a container.
46 </refpurpose>
47 </refnamediv>
48
49 <refsynopsisdiv>
50 <cmdsynopsis>
b4578c5b
DE
51 <command>lxc-execute</command>
52 <arg choice="req">-n <replaceable>name</replaceable></arg>
53 <arg choice="opt">-f <replaceable>config_file</replaceable></arg>
54 <arg choice="opt">-s KEY=VAL</arg>
55 <arg choice="opt">-- <replaceable>command</replaceable></arg>
d823d5b9 56 </cmdsynopsis>
57 </refsynopsisdiv>
58
59 <refsect1>
60 <title>Description</title>
61
62 <para>
94b81f61
MN
63 <command>lxc-execute</command> runs the specified
64 <replaceable>command</replaceable> inside the container
65 specified by <replaceable>name</replaceable>.
66 </para>
67 <para>
68 It will setup the container
69 according to the configuration previously defined with the
70 lxc-create command or with the configuration file parameter.
71 If no configuration is
72 defined, the default isolation is used.
d823d5b9 73 </para>
d823d5b9 74 <para>
75 This command is mainly used when you want to quickly launch an
94b81f61 76 application in an isolated environment.
d823d5b9 77 </para>
94b81f61
MN
78 <para>
79 <command>lxc-execute</command> command will run the
80 specified command into the container via an intermediate
81 process, <command>lxc-init</command>.
82 This lxc-init after launching the specified command,
83 will wait for its end and all other reparented processes.
36b33520 84 (to support daemons in the container).
94b81f61
MN
85 In other words, in the
86 container, <command>lxc-init</command> has the pid 1 and the
87 first process of the application has the pid 2.
88 </para>
e4b3fe58 89 <para>
90 The above <command>lxc-init</command> is designed to forward received
91 signals to the started command.
e4b3fe58 92 </para>
d823d5b9 93 </refsect1>
94
95 <refsect1>
96 <title>Options</title>
97 <variablelist>
98
d823d5b9 99 <varlistentry>
100 <term>
94b81f61 101 <option>-f, --rcfile <replaceable>config_file</replaceable></option>
d823d5b9 102 </term>
103 <listitem>
104 <para>
105 Specify the configuration file to configure the virtualization
106 and isolation functionalities for the container.
107 </para>
94b81f61
MN
108 <para>
109 This configuration file if present will be used even if there is
110 already a configuration file present in the previously created
111 container (via lxc-create).
112 </para>
d823d5b9 113 </listitem>
114 </varlistentry>
20117280
CLG
115 <varlistentry>
116 <term>
94b81f61 117 <option>-s, --define <replaceable>KEY=VAL</replaceable></option>
20117280
CLG
118 </term>
119 <listitem>
120 <para>
121 Assign value <replaceable>VAL</replaceable> to configuration
122 variable <replaceable>KEY</replaceable>. This overrides any
123 assignment done in <replaceable>config_file</replaceable>.
124 </para>
125 </listitem>
126 </varlistentry>
dfafa5a5
CLG
127 <varlistentry>
128 <term><option>--</option></term>
129 <listitem>
130 <para>
131 Signal the end of options and disables further option
132 processing. Any arguments after the -- are treated as
1354f952 133 arguments to <replaceable>command</replaceable>.
dfafa5a5
CLG
134 </para>
135 <para>
1354f952
DE
136 This option is useful when you want specify options
137 to <replaceable>command</replaceable> and don't want
138 <command>lxc-execute</command> to interpret them.
dfafa5a5
CLG
139 </para>
140 </listitem>
141 </varlistentry>
d823d5b9 142
143 </variablelist>
144
145 </refsect1>
146
10fba81b
MN
147 &commonoptions;
148
d823d5b9 149 <refsect1>
150 <title>Diagnostic</title>
151
152 <variablelist>
153
154 <varlistentry>
155 <term>The container is busy</term>
156 <listitem>
157 <para>
158 The specified container is already running an
159 application. You should stop it before reuse this
160 container or create a new one.
161 </para>
162 </listitem>
f79d43bb 163 </varlistentry>
d823d5b9 164
165 </variablelist>
166
167 </refsect1>
168
99e4008c 169 &seealso;
d823d5b9 170
171 <refsect1>
172 <title>Author</title>
173 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
174 </refsect1>
175
176</refentry>
177
178<!-- Keep this comment at the end of the file
179Local variables:
180mode: sgml
181sgml-omittag:t
182sgml-shorttag:t
183sgml-minimize-attributes:nil
184sgml-always-quote-attributes:t
185sgml-indent-step:2
186sgml-indent-data:t
187sgml-parent-document:nil
188sgml-default-dtd-file:nil
189sgml-exposed-tags:nil
190sgml-local-catalogs:nil
191sgml-local-ecat-files:nil
192End:
193-->