1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
|
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<!DOCTYPE refentry PUBLIC @docdtd@ [
<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
]>
<refentry>
<docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
<refmeta>
<refentrytitle>lxc-autostart</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>lxc-autostart</refname>
<refpurpose>
start/stop/kill auto-started containers
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>lxc-autostart</command>
<arg choice="opt">-k</arg>
<arg choice="opt">-L</arg>
<arg choice="opt">-r</arg>
<arg choice="opt">-s</arg>
<arg choice="opt">-a</arg>
<arg choice="opt">-A</arg>
<arg choice="opt">-g <replaceable>groups</replaceable></arg>
<arg choice="opt">-t <replaceable>timeout</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>lxc-autostart</command> processes containers
with lxc.start.auto set. It lets the user start, shutdown,
kill, restart containers in the right order, waiting the
right time. Supports filtering by lxc.group or just run
against all defined containers. It can also be used by
external tools in list mode where no action will be performed
and the list of affected containers (and if relevant, delays)
will be shown.
</para>
<para>
The <optional>-r</optional>, <optional>-s</optional>
and <optional>-k</optional> options specify the action to perform.
If none is specified, then the containers will be started.
<optional>-a</optional> and <optional>-g</optional> are used to
specify which containers will be affected. By default only
containers without a lxc.group set will be affected.
<optional>-t TIMEOUT</optional> specifies the maximum amount
of time to wait for the container to complete the shutdown
or reboot.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term>
<option>-r,--reboot </option>
</term>
<listitem>
<para>
Request a reboot of the container.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-s,--shutdown </option>
</term>
<listitem>
<para>
Request a clean shutdown. If a
<optional>-t timeout</optional> greater than 0 is
given and the container has not shut down within
this period, it will be killed as with the
<optional>-k kill</optional> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-k,--kill </option>
</term>
<listitem>
<para>
Rather than requesting a clean shutdown of the
container, explicitly kill all tasks in the container.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-L,--list </option>
</term>
<listitem>
<para>
Rather than performing the action, just print
the container name and wait delays until starting the next container.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-t,--timeout <replaceable>TIMEOUT</replaceable></option>
</term>
<listitem>
<para>
Wait TIMEOUT seconds before hard-stopping the container.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-g,--groups <replaceable>GROUP</replaceable></option>
</term>
<listitem>
<para>
Comma separated list of groups to select
(defaults to those without a lxc.group - the NULL group).
This option may be specified multiple times
and the arguments concatenated. The NULL or
empty group may be specified as a leading comma,
trailing comma, embedded double comma, or empty
argument where the NULL group should be processed.
Groups are processed in the order specified on the
command line. Multiple invocations of the -g option
may be freely intermixed with the comma separated
lists and will be combined in specified order.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-a,--all</option>
</term>
<listitem>
<para>
Ignore lxc.group and select all auto-started containers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-A,--ignore-auto</option>
</term>
<listitem>
<para>
Ignore the lxc.start.auto flag. Combined with
-a, will select all containers on the system.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Autostart and System Boot</title>
<para>
The <command>lxc-autostart</command> command is used as part of the
LXC system service, when enabled to run on host system at bootup and at
shutdown. It's used to select which containers to start in what order
and how much to delay between each startup when the host system boots.
</para>
<para>
Each container can be part of any number of groups or no group at all.
Two groups are special. One is the NULL group, i.e. the container does
not belong to any group. The other group is the "onboot" group.
</para>
<para>
When the system boots with the LXC service enabled, it will first
attempt to boot any containers with lxc.start.auto == 1 that is a member
of the "onboot" group. The startup will be in order of lxc.start.order.
If an lxc.start.delay has been specified, that delay will be honored
before attempting to start the next container to give the current
container time to begin initialization and reduce overloading the host
system. After starting the members of the "onboot" group, the LXC system
will proceed to boot containers with lxc.start.auto == 1 which are not
members of any group (the NULL group) and proceed as with the onboot
group.
</para>
</refsect1>
<refsect1>
<title>Startup Group Examples</title>
<variablelist>
<varlistentry>
<term>
<option>-g "onboot,"</option>
</term>
<listitem>
<para>
Start the "onboot" group first then the NULL group.
</para>
<para>
This is the equivalent of: <option>-g onboot -g ""</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-g "dns,web,,onboot"</option>
</term>
<listitem>
<para>
Starts the "dns" group first, the "web" group second, then
the NULL group followed by the "onboot" group.
</para>
<para>
This is the equivalent of: <option>-g dns,web -g ,onboot</option> or <option>-g dns -g web -g "" -g onboot</option>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
&seealso;
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|