[lxc-devel] [lxcfs/master] hooks: skip mounting lxcfs cgroup tree on centos 7 hosts
tomponline on Github
lxc-bot at linuxcontainers.org
Tue Jan 22 12:47:37 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 703 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190122/c698c490/attachment.bin>
-------------- next part --------------
From 059dd49377a341ea99ed05b2171a4d81a0287d59 Mon Sep 17 00:00:00 2001
From: tomponline <tomp at tomp.uk>
Date: Tue, 22 Jan 2019 12:43:52 +0000
Subject: [PATCH] hooks: Modifies lxc.mount.hook to skip mounting lxcfs cgroup
tree when running CentOS 7 on the host.
This is due to instabilities when running lxcfs on CentOS 7 hosts.
/proc mounts do not cause any problems, so those are not skipped.
systemd containers still start OK with cgroup tree not mounted into lxcfs on CentOS 7 hosts.
Signed-off-by: tomponline <tomp at tomp.uk>
---
share/lxc.mount.hook.in | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/share/lxc.mount.hook.in b/share/lxc.mount.hook.in
index 8fc4748..e418213 100755
--- a/share/lxc.mount.hook.in
+++ b/share/lxc.mount.hook.in
@@ -28,6 +28,15 @@ else
exit 0
fi
+# Skip mounting cgroup tree on CentOS 7 as causes instability in lxcfs and is not needed.
+if [ -f /etc/os-release ]; then
+ . /etc/os-release
+ if [ ${ID} == "centos" ] && [ ${VERSION_ID} == "7" ]; then
+ logger -t lxcfs.mount.hook "Skipping cgroup mounts for CentOS 7 host"
+ exit 0
+ fi
+fi
+
# /sys/fs/cgroup files
if [ -d "${LXC_ROOTFS_MOUNT}/sys/fs/cgroup" ]; then
if [ -d @LXCFSTARGETDIR@/cgroup ]; then
More information about the lxc-devel
mailing list