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