The cgroup mounts created by cgroup-bin do not show up in /etc/mtab.
lxc-ls, as lxc-ps before it, assumes that /etc/mtab is symlinked to
/proc/mounts.
Author: Serge Hallyn <serge.hal...@canonical.com>
Forwarded: no
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/819319

Index: lxc/src/lxc/lxc-ls.in
===================================================================
--- lxc.orig/src/lxc/lxc-ls.in  2011-08-01 09:25:00.298567408 -0500
+++ lxc/src/lxc/lxc-ls.in       2011-08-01 09:25:33.918568164 -0500
@@ -10,12 +10,16 @@
 {
        local mount_string
        mount_string=$(mount -t cgroup |grep -E -e '^lxc ')
-       if test -z "$mount_string"; then
-               mount_string=$(mount |grep -m1 'type cgroup')
-       fi
        if test -n "$mount_string"; then
                mount_point=$(echo $mount_string |cut -d' ' -f3)
+               return
+       fi
+       mount_string=`grep -m1 -E '^[^ \t]+[ \t]+[^ \t]+[ \t]+cgroup' 
/proc/self/mounts`;
+       if test -z "$mount_string"; then
+               echo "failed to find mounted cgroup"
+               exit 1
        fi
+       mount_point=`echo "$mount_string" |cut -d' ' -f2`;
 }
 
 ls "$@" $lxcpath

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to