Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation request: autostart #529

Closed
assarbad opened this issue May 17, 2015 · 3 comments
Closed

Documentation request: autostart #529

assarbad opened this issue May 17, 2015 · 3 comments

Comments

@assarbad
Copy link

Hi,

I'm trying to get the autostart feature to work with root-owned userns-containers on Ubuntu. LXC version is 1.0.7 on Trusty (14.04).

Now I have read #161 and initially I was using the method of setting lxc.start.auto = 1.

When I list the containers with lxc-ls the autostart settings are shown as desired.

There are two things that I figure may be an issue in my setup. In /etc/lxc/lxc.conf I set:

lxc.lxcpath = /data/LXC

where the target path is a btrfs volume with one subvolume per container.

Second thing is that the configuration snippet containing the lxc.start.auto = 1 is in fact inside a subfolder in /etc/lxc and gets included in the main configuration (/data/LXC/*/config) via lxc.include.

Additionally lxc-autostart -a starts up all the containers that are configured to autostart in the configured order.

So I'm wondering how would I debug this and where can I find documentation on how LXC parses the configuration and by which mechanism the autostart kicks in during system startup.

Thanks,

// Oliver

PS: lxc-autostart -L gives no output, which explains why the upstart job doesn't autostart containers.
PPS: I also tried adding the lxc.start.auto = 1 to the container config (not in an include) and reverted to /var/lib/lxc to no avail.

@assarbad
Copy link
Author

I found a workaround, albeit a silly one.

If I set lxc.start.auto = 1 (no matter whether in the main container config or in the snippet) and also make the containers member of the group ongroup (lxc.group = onboot), it does work.

This is due to the defaults in the upstart job where the bootgroup variable defines that as the first group to start. I verified before testing it, that lxc-autostart -L -g onbooot, would give me the desired output.

In essence it means that I need two settings in order to make the lxc.start.auto = 1 setting take effect.

@MelkorLord
Copy link

Hi,

There's more to add to this issue. In previous versions of LXC, "lxc.start.order" had to be high for the container to start before others. Somewhere on the path of evolution, the meaning of this setting was inverted! Now, the lower the number, the higher is the priority. All my containers where starting in the wrong order after upgrade of LXC! I haven't seen any documentation update to mention that :-(

@stgraber
Copy link
Member

It was mentioned very prominently in the release announcement for 2.0.

https://linuxcontainers.org/lxc/news/#change-in-behavior

@brauner brauner closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants