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