Open amezin opened 7 years ago
Afaik, this is expected behavior. Config lines override each other in the order they are specified in.
Closing as this is expected behavior.
Yes, it works correctly, but why should single set_config_item
generate two lines in config file, one of which is useless garbage?
Oh wait, maybe I misunderstood you. Are you saying that one single call to:
container.set_config_item('lxc.cgroup.memory.memsw.limit_in_bytes', memsw_limit)
will set two lines in the container's config file?
One single call to
container.set_config_item('lxc.cgroup.memory.memsw.limit_in_bytes', memsw_limit)
(+ container.save_config() of course) will produce this:
...
lxc.cgroup.memory.memsw.limit_in_bytes =
lxc.cgroup.memory.memsw.limit_in_bytes = 4G
...
even if there were no "lxc.cgroup.memory.memsw.limit_in_bytes" lines in the config file before the call
Right, sorry I misunderstood. :)
This fails starting a container on ubuntu 16.04 (lxc 2.0.8-0ubuntu1~16.04.2)
when I override some settings from python
Failed to parse config: lxc.rootfs.backend =
Once we release the new config file parser this should be fixed.
This just bit me, and it breaks lxc-ls. I'm using 2.0.8-0ubuntu1~16.04.2
When did this sneak in? It's a bit of a dumpster fire, now I can't query any of my 20 containers.
@dankegel, what exactly?
I'm not quite sure what's going on, but I have about ten ubuntu 16.04 systems each running several containers (in a configuration roughly unchanged since 2012).
On machines with 2.0.7-0ubuntu1~16.04.2, I see duplicate empty lxc.hook.pre-mount lines before the real one, but that doesn't seem to bother lxc-ls.
On machines with 2.0.8-0ubuntu1~16.04.2, I also see duplicate empty lxc.ephemeral lines before the real ones, and lxc-ls complains lxc-ls: parse.c: lxc_file_for_each_line: 57 Failed to parse config: lxc.ephemeral = If I remove the empty duplicate, lxc-ls works again.
I have no idea what creates those lines, my script "just" calls lxc-start.
I suppose I can just modify my script to remove the bogus line after creating each new ephemeral container... so it's only a dumpster fire in the "oh, man, not another distraction!" sense.
Second.
Is this still a problem with LXC 2.0.9?
Yes, this still a problem with LXC 2.0.11 on Ubuntu 16.04 using python3-lxc lib. For some weird reason, generate two outputs.
Can you try with master too, please?
I will try and post here an update.
Thanks!
@brauner I tested with version 2.0.8 that I clone from GitHub directly. The problem was: when I create an object to run an LXC container and save its configuration, the production was 2 line of configurations, one:
lxc.cgroup.memory.limit_in_bytes =
lxc.cgroup.memory.limit_in_bytes = 256M
lxc.cgroup.cpuset.cpus =
lxc.cgroup.cpuset.cpus = 1
I start to inspect what's causing it... I know that the second line is the effective one... but the configuration file becomes a little bit full of blank lines.
With Python bindings:
generates following lines in container config:
And if there are other
set_config_item
s before 'lxc.cgroup.memory.limit_in_bytes':Happens on current stable-2.0 branch, haven't tested master branch yet