]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ps: display process when container is frozen
authorWeng Meiling <wengmeiling.weng@huawei.com>
Thu, 6 Jun 2013 11:59:31 +0000 (19:59 +0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 10 Jun 2013 12:11:54 +0000 (07:11 -0500)
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 <wengmeiling.weng@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc-ps.in

index d04f81561f3b7d249adeb8bfb0daa72d001ed4aa..1ecd067f95d5abed4ab0299d9f19a5ee3dd8fb7b 100644 (file)
@@ -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