[Admin] LXC Automatically start your containers

Automatically start your containers

To automatically start your containers at boot, all you have to do is
to put symlinks to your containers config files in the /etc/lxc/auto/
directory. For example for your previously created container (it's
important that your symlink has the same name as your container):

sudo ln -s /var/lib/lxc/myfirstcontainer/config /etc/lxc
/auto/myfirstcontainer
quelle:
http://sylvain.fankhauser.name/setting-up-lxc-containers-in-30-minutes-debian-wheezy.html

also habe ich kurzer hand
# ls -all /etc/lxc/auto
insgesamt 8
drwxr-xr-x 2 root root 4096 Jul 11 06:50 ./
drwxr-xr-x 3 root root 4096 Jul 11 06:49 ../
lrwxrwxrwx 1 root root 23 Jul 11 06:49 git -> /var/lib/lxc/git/config
lrwxrwxrwx 1 root root 25 Jul 11 06:49 mysql ->
/var/lib/lxc/mysql/config
lrwxrwxrwx 1 root root 26 Jul 11 06:49 nagios ->
/var/lib/lxc/nagios/config
lrwxrwxrwx 1 root root 23 Jul 11 06:50 web -> /var/lib/lxc/web/config

erstellt.

da ich keine ahnung von lxc habe, bitte mal testen ob autostart klappt.

- --
gruß
pic

@ME https://wiki.nordwest.freifunk.net/picard

Ich gucke gleich mal drüber und teste es

LG
Tarek

und erkläre mir bitte wie du es getestet hast, damit ich dabei was lerne :wink:
oder wo ich es nachlesen kann danke :slight_smile:

Ich hab den server einfach mal rebooted Ergebnis ist die Container
kommen icht automatisch up. Hab es aber uch noch nicht geschaft in die
Config zu gucken

LG
Tarek

/var/lib/lxc/mycontainer/config:
lxc.start.auto = 1
lxc.group = onboot

habe ich eingetragen und kommentiert, getestet, klappt.
zeigt sich als /usr/bin/lxc-autostart

AUSSER bei GIT, der auto_startet_nicht *wood*
Debuggen, ich habe es auf meiner TODO

man lxc-autostart
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.

wir können also noch mehr tun.
1. reihenfolge
2. verzögerung