like lxc-ps and lxc-ls, lxc-netstat breaks if there is not an 'lxc' cgroup
mount and /etc/mtab is not a link to /proc/mounts.
Author: Serge Hallyn <serge.hal...@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/819319
Forwarded: no

Index: lxc/src/lxc/lxc-netstat.in
===================================================================
--- lxc.orig/src/lxc/lxc-netstat.in     2011-08-01 10:17:02.909590412 -0500
+++ lxc/src/lxc/lxc-netstat.in  2011-08-01 11:22:11.509678274 -0500
@@ -60,6 +60,16 @@
 done
 
 if [ -z "$cgroup_path" ]; then
+       cgroups=`grep -m1 -E '^[^ \t]+[ \t]+[^ \t]+[ \t]+cgroup' 
/proc/self/mounts`
+       for i in "$cgroups"; do
+           cgroup_path=$(echo $i | awk ' { print $2 } ')
+           if [ -n $cgroup_path ]; then
+               break;
+           fi
+       done
+fi
+
+if [ -z "$cgroup_path" ]; then
     echo "no cgroup mount point found"
     exit 1
 fi

------------------------------------------------------------------------------
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