mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-06-14 16:47:06 +00:00
cgfs: do not automount if cgroup namespaces are supported
In that case containers will be able to mount cgroup filesystems for themselves as they do on a host. This fixes inability to start systemd based containers on cgns-enabled kernels with cgmanager not running. I've tested debian jessie, busybox, ubuntu trusty and xenial, all of which booted ok. However if there are some setups which require premounted cgroupfs (i.e. they don't mount if they detect being in a container), this may cause trouble. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
55290b8333
commit
4608594e1d
@ -912,7 +912,7 @@ proc proc proc nodev,noexec,nosuid 0 0
|
||||
the container's own cgroup into that directory.
|
||||
The container will be able to write to its own
|
||||
cgroup directory, but not the parents, since they
|
||||
will be remounted read-only
|
||||
will be remounted read-only.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@ -986,6 +986,12 @@ proc proc proc nodev,noexec,nosuid 0 0
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
If cgroup namespaces are enabled, then any <option>cgroup</option>
|
||||
auto-mounting request will be ignored, since the container can
|
||||
mount the filesystems itself, and automounting can confuse the
|
||||
container init.
|
||||
</para>
|
||||
<para>
|
||||
Note that if automatic mounting of the cgroup filesystem
|
||||
is enabled, the tmpfs under
|
||||
|
@ -1356,6 +1356,9 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type)
|
||||
struct cgroup_process_info *info, *base_info;
|
||||
int r, saved_errno = 0;
|
||||
|
||||
if (cgns_supported())
|
||||
return true;
|
||||
|
||||
cgfs_d = hdata;
|
||||
if (!cgfs_d)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user