When a bare environment variable is specified then retrieve the value from the
current environment. For example, setting
lxc.environment = PATH
will cause LXC to inherit the value of PATH from the current environment.
Suggested-by: Jonathan Calmels <jcalmels@nvidia.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
We've announced quite a while back and printed out errors and warning everytime
someone used the aufs driver.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
- remove legacy binaries
- conditionalize creation of docs and tests for the command line tools and the
shared library helper commands
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This allows users to only compile the shared libray without having to compile
any of the command line tools or command helpers for the shared library.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
lxc.console.size regulates the size of the console log file. This is intended
to replace lxc.console.buffer.logfile. The current semantics are:
- if lxc.console.size is not set:
- no limit is placed on the size of the log file
- if lxc.console.size is set:
- if lxc.console.rotate is set and the next write would exceed the limit:
- write as much as possible into the old log file
- rotate the log file
- write as much as posible into the new log file
- discard remaining bytes (scenario shouldn't be possible in normal
circumstances)
- if lxc.console.rotate is not set and the next write would exceed the limit:
- keep overwriting the current log file
To make the log file a mirror of the in-memory ringbuffer simply set:
lxc.console.buffer.size == lxc.console.size.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This lets users specify
lxc.mount.auto = cgroup:mixed:force
or
lxc.mount.auto = cgroup:ro:force
or
lxc.mount.auto = cgroup:rw:force
When cgroup namespaces are supported LXC will not mount cgroups for the
container since it assumes that the init system will mount cgroups itself if it
wants to. This assumption already broke when users wanted to run containers
without CAP_SYS_ADMIN. For example, systemd based containers wouldn't start
since systemd needs to mount cgroups (named systemd hierarchy for legacy
cgroups and the unified hierarchy for unified cgroups) to track processes. This
problem was solved by detecting whether the container had CAP_SYS_ADMIN. If it
didn't we performed the cgroup mounts for it.
However, there are more cases when we should be able to mount cgroups for the
container when cgroup namespaces are supported:
- init systems not mounting cgroups themselves:
A init system that doesn't mount cgroups would not have cgroups available
especially when combined with custom LSM profiles to prevent cgroup
{u}mount()ing inside containers.
- application containers:
Application containers will usually not mount by cgroups themselves.
- read-only cgroups:
It is useful to be able to mount cgroups read-only to e.g. prevent
changing cgroup limits from inside the container while at the same time
allowing the applications to perform introspection on their own cgroups. This
again is mostly useful for application containers. System containers running
systemd will usually not work correctly when cgroups are mounted read-only.
To be fair, all of those use-cases could be covered by custom hooks or
lxc.mount.entry entries but exposing it through lxc.mount.auto takes care of
setting correct mount options and adding the necessary logic to e.g. mount
filesystem read-only correctly.
Currently we only extend this to cgroup:{mixed,ro,rw} but technically there's
no reason not to enable the same behavior for cgroup-full:{mixed,ro,rw} as
well. If someone requests this we can simply treat it as a bug and add "force"
for cgroup-full.
Replaces #2136.
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This can be used by scripts to detect what version of the hooks are used.
Unblocks #2013.
Unblocks #2015.
Closes#1766.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>