Commit 38973621 by Weng Meiling Committed by Serge Hallyn

lxc-ps: display process when container is frozen

When we use lxc-ps to show the process, it's more appropriate to show process when container is frozen. Signed-off-by: 's avatarWeng Meiling <wengmeiling.weng@huawei.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 31f58b3f
......@@ -116,7 +116,7 @@ for container in ${containers}; do
container_field_width=${#container}
fi
if lxc-info -P $lxc_path -t RUNNING -n $container; then
if ! lxc-info -P $lxc_path -t STOPPED -n $container; then
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}'`
if [ -f "$parent_cgroup/$cgroup/tasks" ]; then
......
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