[lxc-devel] disable container start if lxcfs is not running

Dietmar Maurer dietmar at proxmox.com
Thu May 7 05:35:20 UTC 2015


Hi all,

for some unknown reason lxcfs crashed (will try to debug). But after 
that, I am still able to start containers, which now have 
wrong /proc and cgroup mounts.

I wonder if it would be safer to disable container start if 
lxcfs is not running, something like:

Index: new/share/lxc.mount.hook.in
===================================================================
--- new.orig/share/lxc.mount.hook.in
+++ new/share/lxc.mount.hook.in
@@ -15,6 +15,9 @@ if [ -d @LXCFSTARGETDIR@/proc/ ]; then
         [ -e "${LXC_ROOTFS_MOUNT}/proc/$(basename $entry)" ] || continue
         mount -n --bind $entry ${LXC_ROOTFS_MOUNT}/proc/$(basename $entry)
     done
+else
+    >&2 echo "missing /var/lib/lxcfs/proc/ - lxcfs not running?"
+    exit 1
 fi
 
 # /sys/fs/cgroup files



More information about the lxc-devel mailing list