[lxc-devel] [PATCH] [trivial] lxc-ls: Scan cgroup mount points from fstype and not device

Stéphane Graber stgraber at ubuntu.com
Mon Sep 24 13:25:40 UTC 2012


On 12-09-24 05:21 AM, Christian Seiler wrote:
> lxc-ls --active now scans mount points that have the 'cgroup' filesystem
> type and not the 'cgroup' device name (which is ignored anyway and may be
> anything).
> 
> Signed-off-by: Christian Seiler <christian at iwakd.de>
> Cc: Serge Hallyn <serge.hallyn at ubuntu.com>
> ---
>  src/lxc/lxc-ls.in |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
> index 4b9dc77..9293323 100644
> --- a/src/lxc/lxc-ls.in
> +++ b/src/lxc/lxc-ls.in
> @@ -56,7 +56,7 @@ get_parent_cgroup()
>  		init_cgroup=${fields#*:}
>  
>  		# Get the filesystem mountpoint of the hierarchy
> -		mountpoint=$(grep -E "^cgroup [^ ]+ [^ ]+ ([^ ]+,)?$subsystems(,[^ ]+)? " /proc/self/mounts | cut -d ' ' -f 2)
> +		mountpoint=$(grep -E "^[^ ]+ [^ ]+ cgroup ([^ ]+,)?$subsystems(,[^ ]+)? " /proc/self/mounts | cut -d ' ' -f 2)
>  		if [ -z "$mountpoint" ]; then continue; fi
>  
>  		# Return the absolute path to the containers' parent cgroup
> 


Sounds reasonable.
I'll push to staging later today.

Thanks

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20120924/7e789000/attachment.pgp>


More information about the lxc-devel mailing list