Commit 19a85f1f by Nick Huber Committed by Stéphane Graber

Use the cgroup name for cpuset for lxc-ps

On my Ubuntu 13.10 system, lxc-ps was always giving empty output. The output of /proc/$initpid/cgroup was 11:name=systemd:/user/1000.user/c3.session 10:hugetlb:/container 9:perf_event:/container 8:blkio:/container 7:freezer:/container 6:devices:/container 5:memory:/container 4:cpuacct:/container 3:cpu:/container 2:cpuset:/container Using the cpuset line should be a safer option. Signed-off-by: 's avatarNick Huber <nicholashuber@gmail.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent d438f5a0
...@@ -118,7 +118,7 @@ for container in ${containers}; do ...@@ -118,7 +118,7 @@ for container in ${containers}; do
if ! lxc-wait -P $lxc_path -s STOPPED -n $container -t 0; then if ! lxc-wait -P $lxc_path -s STOPPED -n $container -t 0; then
initpid=`lxc-info -P $lxc_path -p -n $container | awk -F: '{ print $2 }' | awk '{ print $1 }'` initpid=`lxc-info -P $lxc_path -p -n $container | awk -F: '{ print $2 }' | awk '{ print $1 }'`
cgroup=`head -n 1 /proc/$initpid/cgroup | awk -F: '{ print $3}'` cgroup=`grep cpuset /proc/$initpid/cgroup | awk -F: '{ print $3}'`
if [ -f "$parent_cgroup/$cgroup/tasks" ]; then if [ -f "$parent_cgroup/$cgroup/tasks" ]; then
tasks_files="$tasks_files $parent_cgroup$cgroup/tasks" tasks_files="$tasks_files $parent_cgroup$cgroup/tasks"
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