[lxc-devel] [PATCH 3/9] lxc-ls: only list active containers

David Ward david.ward at ll.mit.edu
Mon Mar 5 13:34:55 UTC 2012


Originally, lxc-ls listed all containers by printing the directory names
in /var/lib/lxc. After commit 65cb447f9b8d1ac8dcf9df24a4f877180444f003,
lxc-ls now finds and prints active containers by searching for open UNIX
sockets named '/var/lib/lxc/<name>/command'. However, all containers are
still printed using the old method as well, so now the active containers
just get printed twice.

Assuming that the intention of the above commit was to only list active
containers, do not print the directory names in /var/lib/lxc any longer.

Signed-off-by: David Ward <david.ward at ll.mit.edu>
---
 src/lxc/lxc-ls.in |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
index d200509..b923c56 100644
--- a/src/lxc/lxc-ls.in
+++ b/src/lxc/lxc-ls.in
@@ -23,8 +23,6 @@ function get_cgroup()
 	mount_point=`echo "$mount_string" |cut -d' ' -f2`;
 }
 
-ls "$@" $lxcpath
-
 active=$(netstat -xl 2>/dev/null | grep $lxcpath | \
 	sed -e 's#.*'"$lxcpath/"'\(.*\)/command#\1#');
 
-- 
1.7.1





More information about the lxc-devel mailing list