]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
hooks: Adds --skip-cgroup-mounts flag to lxc.mount.hook script.
authortomponline <tomp@tomp.uk>
Wed, 6 Feb 2019 19:49:11 +0000 (19:49 +0000)
committertomponline <tomp@tomp.uk>
Wed, 6 Feb 2019 19:49:11 +0000 (19:49 +0000)
This can be used to avoid instability in LXCFS when running on RHEL 7 hosts.

Signed-off-by: tomponline <tomp@tomp.uk>
share/lxc.mount.hook.in

index 8fc4748f77f779c615a26a1e8547f464839f0405..74a1e46bea7424d4e704c31ebddd292fefcb49d2 100755 (executable)
@@ -1,5 +1,16 @@
 #!/bin/sh -e
 
+# Parse command flags
+while [ ! $# -eq 0 ]
+do
+       case "$1" in
+               --skip-cgroup-mounts )
+                       SKIP_CGROUP_MOUNTS=1
+                       ;;
+       esac
+       shift
+done
+
 # We're dealing with mount entries, so expand any symlink
 LXC_ROOTFS_MOUNT=$(readlink -f ${LXC_ROOTFS_MOUNT})
 
@@ -28,6 +39,11 @@ else
     exit 0
 fi
 
+# Skip mounting cgroup tree if requested.
+if [ "${SKIP_CGROUP_MOUNTS}" == "1" ]; then
+        exit 0
+fi
+
 # /sys/fs/cgroup files
 if [ -d "${LXC_ROOTFS_MOUNT}/sys/fs/cgroup" ]; then
     if [ -d @LXCFSTARGETDIR@/cgroup ]; then