lxc-execute.sgml.in revision 1354f952876e96b456425efc7ed9994caf687028
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainenlxc: linux Container library
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen(C) Copyright IBM Corp. 2007, 2008
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenDaniel Lezcano <daniel.lezcano at free.fr>
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenThis library is free software; you can redistribute it and/or
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainenmodify it under the terms of the GNU Lesser General Public
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenLicense as published by the Free Software Foundation; either
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainenversion 2.1 of the License, or (at your option) any later version.
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenThis library is distributed in the hope that it will be useful,
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainenbut WITHOUT ANY WARRANTY; without even the implied warranty of
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenLesser General Public License for more details.
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo SirainenYou should have received a copy of the GNU Lesser General Public
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo SirainenLicense along with this library; if not, write to the Free Software
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo SirainenFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo Sirainen<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo Sirainen<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo Sirainen<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen run an application inside a container.
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen </refpurpose>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen </refnamediv>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen <refsynopsisdiv>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen <cmdsynopsis>
fd1f0e9ef52b3e157cfd1a01c464c2ac7458ab17Timo Sirainen <arg choice="req">-n <replaceable>name</replaceable></arg>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen <arg choice="opt">-f <replaceable>config_file</replaceable></arg>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen <arg choice="opt">-- <replaceable>command</replaceable></arg>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen </cmdsynopsis>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen </refsynopsisdiv>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <command>lxc-execute</command> runs the specified
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <replaceable>command</replaceable> inside the container
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen It will setup the container
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen according to the configuration previously defined with the
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen lxc-create command or with the configuration file parameter.
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen If no configuration is
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen defined, the default isolation is used.
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen This command is mainly used when you want to quickly launch an
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen application in an isolated environment.
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen <command>lxc-execute</command> command will run the
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen specified command into the container via an intermediate
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen This lxc-init after launching the specified command,
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen will wait for its end and all other reparented processes.
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen (that allows to support daemons in the container).
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen In other words, in the
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen container, <command>lxc-init</command> has the pid 1 and the
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen first process of the application has the pid 2.
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen The above <command>lxc-init</command> is designed to forward received
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen signals to the started command.
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen So <command>lxc-kill</command> (1) sent signal is received
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen by the user specified command (pid 2 in the container).
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen <variablelist>
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen <varlistentry>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <option>-f, --rcfile <replaceable>config_file</replaceable></option>
1964dbea138cb4a213b1bce1eeee68992b18829aTimo Sirainen Specify the configuration file to configure the virtualization
1964dbea138cb4a213b1bce1eeee68992b18829aTimo Sirainen and isolation functionalities for the container.
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen This configuration file if present will be used even if there is
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen already a configuration file present in the previously created
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen container (via lxc-create).
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen </varlistentry>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <varlistentry>
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen <option>-s, --define <replaceable>KEY=VAL</replaceable></option>
1964dbea138cb4a213b1bce1eeee68992b18829aTimo Sirainen Assign value <replaceable>VAL</replaceable> to configuration
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen variable <replaceable>KEY</replaceable>. This overrides any
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen assignment done in <replaceable>config_file</replaceable>.
ec096c8a0f52a4bb5d12aa9afe1a576368aa8094Timo Sirainen </varlistentry>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <varlistentry>
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen Signal the end of options and disables further option
4dc5662260a63669054cd0dc1bac2ccab3fa2ae7Timo Sirainen processing. Any arguments after the -- are treated as
4dc5662260a63669054cd0dc1bac2ccab3fa2ae7Timo Sirainen arguments to <replaceable>command</replaceable>.
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo Sirainen This option is useful when you want specify options
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen to <replaceable>command</replaceable> and don't want
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen <command>lxc-execute</command> to interpret them.
0a3d3ca7db7cbdc947ccabe740c40561b3f5c066Timo Sirainen </varlistentry>
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen </variablelist>
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen &commonoptions;
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen <variablelist>
6a029ebed745994ce2e5f64182d8b5c8f10d53d6Timo Sirainen <varlistentry>
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen The specified container is already running an
f6c0407545ee77d4647c8cd912e3156b0a48e2f1Timo Sirainen application. You should stop it before reuse this
a40f21e8239a87a8fab2648955b0f568908ca8b5Timo Sirainen container or create a new one.
35565557e05721a761132cec2ba1d93acacb6c14Timo Sirainen </varlistentry>
dcc76bb1e1bb287e3e71e6a39a7ca207fab0eaa8Timo Sirainen </variablelist>