lxc-autostart.sgml.in revision 3ae656b54b1688d1eb8332f80f356773e762cc99
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher(C) Copyright 2013 Canonical Ltd.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherStéphane Graber <stgraber@ubuntu.com>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherThis library is free software; you can redistribute it and/or
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallaghermodify it under the terms of the GNU Lesser General Public
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherLicense as published by the Free Software Foundation; either
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagherversion 2.1 of the License, or (at your option) any later version.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherThis library is distributed in the hope that it will be useful,
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagherbut WITHOUT ANY WARRANTY; without even the implied warranty of
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherLesser General Public License for more details.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherYou should have received a copy of the GNU Lesser General Public
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherLicense along with this library; if not, write to the Free Software
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
a473fb88e6015cf0ccbd2e9005c7e6acca18f452Pavel Březina <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <refnamediv>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <refpurpose>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose </refpurpose>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose </refnamediv>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <refsynopsisdiv>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <cmdsynopsis>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <arg choice="opt">-g <replaceable>groups</replaceable></arg>
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose <arg choice="opt">-t <replaceable>timeout</replaceable></arg>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose </cmdsynopsis>
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose </refsynopsisdiv>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <command>lxc-autostart</command> processes containers
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose with lxc.start.auto set. It lets the user start, shutdown,
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose kill, restart containers in the right order, waiting the
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose right time. Supports filtering by lxc.group or just run
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose against all defined containers. It can also be used by
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose external tools in list mode where no action will be performed
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose and the list of affected containers (and if relevant, delays)
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose will be shown.
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose The <optional>-r</optional>, <optional>-s</optional>
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose and <optional>-k</optional> options specify the action to perform.
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose If none is specified, then the containers will be started.
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose <optional>-a</optional> and <optional>-g</optional> are used to
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose specify which containers will be affected. By default only
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose containers without a lxc.group set will be affected.
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose <optional>-t TIMEOUT</optional> specifies the maximum amount
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose of time to wait for the container to complete the shutdown
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose <variablelist>
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose <varlistentry>
3d9bafcbb5c0fbf23351004ded4dea6aa13127fcSumit Bose Request a reboot of the container.
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose </varlistentry>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <varlistentry>
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose Request a clean shutdown. If a
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose <optional>-t timeout</optional> greater than 0 is
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose given and the container has not shut down within
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose this period, it will be killed as with the
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose </varlistentry>
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose <varlistentry>
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose Rather than requesting a clean shutdown of the
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose container, explicitly kill all tasks in the container.
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose </varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher Rather than performing the action, just print
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher the container name and wait delays until starting the next container.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <varlistentry>
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek <option>-t,--timeout <replaceable>TIMEOUT</replaceable></option>
df0596ec12bc5091608371e2977f3111241e8cafSimo Sorce Wait TIMEOUT seconds before hard-stopping the container.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <option>-g,--group <replaceable>GROUP</replaceable></option>
bfb40893be20b45279a40188cf16ef0eec1f9423Sumit Bose Comma separated list of groups to select
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher (defaults to those without a lxc.group - the NULL group).
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek This option may be specified multiple times
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek and the arguments concatenated. The NULL or
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek empty group may be specified as a leading comma,
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek trailing comma, embedded double comma, or empty
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek argument where the NULL group should be processed.
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek Groups are processed in the order specified on the
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek command line. Multiple invocations of the -g option
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek may be freely intermixed with the comma separated
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek lists and will be combined in specified order.
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek </varlistentry>
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek <varlistentry>
bfdb2eeed95bde6cd065a9a47a7cb1773990ccfbOndrej Kos Ignore lxc.group and select all auto-started containers.
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek </varlistentry>
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek <varlistentry>
a473fb88e6015cf0ccbd2e9005c7e6acca18f452Pavel Březina Ignore the lxc.start.auto flag. Combined with
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher -a, will select all containers on the system.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </variablelist>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher The <command>lxc-autostart</command> command is used as part of the
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher LXC system service, when enabled to run on host system at bootup and at
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek shutdown. It's used to select which containers to start in what order
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek and how much to delay between each startup when the host system boots.
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek Each container can be part of any number of groups or no group at all.
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek Two groups are special. One is the NULL group, i.e. the container does
46222e5191473f9a46aec581273eb2eef22e23beMichal Zidek not belong to any group. The other group is the "onboot" group.
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose When the system boots with the LXC service enabled, it will first
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose attempt to boot any containers with lxc.start.auto == 1 that is a member
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose of the "onboot" group. The startup will be in order of lxc.start.order.
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose If an lxc.start.delay has been specified, that delay will be honored
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose before attempting to start the next container to give the current
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose container time to begin initialization and reduce overloading the host
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose system. After starting the members of the "onboot" group, the LXC system
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose will proceed to boot containers with lxc.start.auto == 1 which are not
949fbc93defad394648b2651b43a7bbfa5bff42bSumit Bose members of any group (the NULL group) and proceed as with the onboot
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <variablelist>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher Start the "onboot" group first then the NULL group.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher This is the equivalent of: <option>-g onboot -g ""</option>.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher Starts the "dns" group first, the "web" group second, then
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher the NULL group followed by the "onboot" group.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher This is the equivalent of: <option>-g dns,web -g ,onboot</option> or <option>-g dns -g web -g "" -g onboot</option>.
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </varlistentry>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher </variablelist>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher <para>Stéphane Graber <email>stgraber@ubuntu.com</email></para>
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallagher<!-- Keep this comment at the end of the file
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen GallagherLocal variables:
af58b15fa7f20e33736d79c6a4b3becb568517caLukas Slebodniksgml-omittag:t
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallaghersgml-shorttag:t
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallaghersgml-minimize-attributes:nil
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallaghersgml-always-quote-attributes:t
505e75ba28b42bb3de7a6d55de825091b70cc2b2Stephen Gallaghersgml-indent-step:2
4f3fd1fb264a7eaf3a9d062d49e071b0d17e4debStephen Gallaghersgml-indent-data:t
4f3fd1fb264a7eaf3a9d062d49e071b0d17e4debStephen Gallaghersgml-parent-document:nil
4f3fd1fb264a7eaf3a9d062d49e071b0d17e4debStephen Gallaghersgml-default-dtd-file:nil
4f3fd1fb264a7eaf3a9d062d49e071b0d17e4debStephen Gallaghersgml-exposed-tags:nil
4f3fd1fb264a7eaf3a9d062d49e071b0d17e4debStephen Gallaghersgml-local-catalogs:nil
4f3fd1fb264a7eaf3a9d062d49e071b0d17e4debStephen Gallaghersgml-local-ecat-files:nil