From: Weng Meiling Date: Thu, 6 Jun 2013 11:59:31 +0000 (+0800) Subject: lxc-ps: display process when container is frozen X-Git-Tag: lxc-1.0.0.alpha1~1^2~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38973621a40a5657b067409321d54759520d7951;p=thirdparty%2Flxc.git 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: Weng Meiling Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc-ps.in b/src/lxc/lxc-ps.in index d04f81561..1ecd067f9 100644 --- a/src/lxc/lxc-ps.in +++ b/src/lxc/lxc-ps.in @@ -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