Commit 0a1259d9 by Serge E. Hallyn Committed by Daniel Lezcano

make lxc-netstat work when /etc/mtab is not /proc/mounts

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.hallyn@canonical.com> Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/819319 Forwarded: no Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 93884589
...@@ -60,6 +60,16 @@ for i in "$cgroups"; do ...@@ -60,6 +60,16 @@ for i in "$cgroups"; do
done done
if [ -z "$cgroup_path" ]; then 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" echo "no cgroup mount point found"
exit 1 exit 1
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment