[lxc-devel] [PATCH] lxc-ps: display process when container is frozen
Weng Meiling
wengmeiling.weng at huawei.com
Thu Jun 6 11:59:31 UTC 2013
From: Weng Meiling <wengmeiling.weng at huawei.com>
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 at huawei.com>
---
src/lxc/lxc-ps.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/lxc/lxc-ps.in b/src/lxc/lxc-ps.in
index 29e8097..4d5bd69 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
-- 1.7.1
More information about the lxc-devel
mailing list