1lxc-autostart(1)                                              lxc-autostart(1)
2
3
4

NAME

6       lxc-autostart - start/stop/kill auto-started containers
7

SYNOPSIS

9       lxc-autostart [-k] [-L] [-r] [-s] [-a] [-A] [-g groups] [-t timeout]
10

DESCRIPTION

12       lxc-autostart processes containers with lxc.start.auto set. It lets the
13       user start, shutdown, kill, restart  containers  in  the  right  order,
14       waiting  the  right  time.  Supports filtering by lxc.group or just run
15       against all defined containers. It can also be used by  external  tools
16       in list mode where no action will be performed and the list of affected
17       containers (and if relevant, delays) will be shown.
18
19       The [-r], [-s] and [-k] options specify the action to perform.  If none
20       is  specified,  then the containers will be started.  [-a] and [-g] are
21       used to specify which containers will be affected. By default only con‐
22       tainers  without a lxc.group set will be affected.  [-t TIMEOUT] speci‐
23       fies the maximum amount of time to wait for the container  to  complete
24       the shutdown or reboot.
25

OPTIONS

27       -r,--reboot
28              Request a reboot of the container.
29
30       -s,--shutdown
31              Request  a  clean  shutdown. If a [-t timeout] greater than 0 is
32              given and the container has not shut down within this period, it
33              will be killed as with the [-k kill] option.
34
35       -k,--kill
36              Rather  than  requesting  a clean shutdown of the container, ex‐
37              plicitly kill all tasks in the container.
38
39       -L,--list
40              Rather than performing the action, just print the container name
41              and wait delays until starting the next container.
42
43       -t,--timeout TIMEOUT
44              Wait TIMEOUT seconds before hard-stopping the container.
45
46       -g,--group GROUP
47              Comma  separated  list  of  groups  to select (defaults to those
48              without a lxc.group - the NULL group).  This option may be spec‐
49              ified multiple times and the arguments concatenated. The NULL or
50              empty group may be specified as a leading comma, trailing comma,
51              embedded  double  comma,  or empty argument where the NULL group
52              should be processed.  Groups are processed in the  order  speci‐
53              fied  on the command line. Multiple invocations of the -g option
54              may be freely intermixed with the comma separated lists and will
55              be combined in specified order.
56
57       -a,--all
58              Ignore lxc.group and select all auto-started containers.
59
60       -A,--ignore-auto
61              Ignore  the  lxc.start.auto  flag. Combined with -a, will select
62              all containers on the system.
63

AUTOSTART AND SYSTEM BOOT

65       The lxc-autostart command is used as part of the  LXC  system  service,
66       when enabled to run on host system at bootup and at shutdown. It's used
67       to select which containers to start in what order and how much to delay
68       between each startup when the host system boots.
69
70       Each  container can be part of any number of groups or no group at all.
71       Two groups are special. One is the NULL group, i.e. the container  does
72       not belong to any group. The other group is the "onboot" group.
73
74       When  the  system boots with the LXC service enabled, it will first at‐
75       tempt to boot any containers with lxc.start.auto == 1 that is a  member
76       of the "onboot" group. The startup will be in order of lxc.start.order.
77       If an lxc.start.delay has been specified, that delay  will  be  honored
78       before  attempting to start the next container to give the current con‐
79       tainer time to begin initialization and  reduce  overloading  the  host
80       system.  After starting the members of the "onboot" group, the LXC sys‐
81       tem will proceed to boot containers with lxc.start.auto == 1 which  are
82       not  members  of any group (the NULL group) and proceed as with the on‐
83       boot group.
84

STARTUP GROUP EXAMPLES

86       -g "onboot,"
87              Start the "onboot" group first then the NULL group.
88
89              This is the equivalent of: -g onboot -g "".
90
91       -g "dns,web,,onboot"
92              Starts the "dns" group first, the "web" group second,  then  the
93              NULL group followed by the "onboot" group.
94
95              This  is  the  equivalent of: -g dns,web -g ,onboot or -g dns -g
96              web -g "" -g onboot.
97

SEE ALSO

99       lxc(7), lxc-create(1), lxc-copy(1), lxc-destroy(1), lxc-start(1),  lxc-
100       stop(1),  lxc-execute(1),  lxc-console(1), lxc-monitor(1), lxc-wait(1),
101       lxc-cgroup(1), lxc-ls(1), lxc-info(1), lxc-freeze(1),  lxc-unfreeze(1),
102       lxc-attach(1), lxc.conf(5)
103

AUTHOR

105       Stéphane Graber <stgraber@ubuntu.com>
106
107
108
109                                  2021-01-18                  lxc-autostart(1)
Impressum