[Lxc-users] make lxc-ps work with separate mtab

Serge E. Hallyn serge.hallyn at canonical.com
Thu Aug 4 14:30:13 UTC 2011


Quoting Daniel Lezcano (daniel.lezcano at free.fr):
> On 07/28/2011 08:19 PM, Serge E. Hallyn wrote:
> > It breaks with multiple cgroup mounts unless /etc/mtab is linked
> > to /proc/self/mounts (which it is not in Ubuntu, for instance).
> >
> > Signed-off-by: Serge Hallyn <serge.hallyn at canonical.com>
> 
> Hi Serge,
> 
> not sure, you got the email

No, I did not.  Where did you send it to?

> but I was not able to apply this one.

Ah I see, I didn't have commit c011782c8d83ece9ee883fcd9406433c09f220be.
The jist of this hunk is: ns cgroup might not need to be mounted, so
accept any cgroup entry.

(Yes, this still makes assumptions - namely that the container is
in the same group for all cgroups;  but I think that makes more
sense than assuming that ns cgroup is mounted somewhere)

Do you want me to send a new patch, or do you want to tweak it
in-flight?

thanks,
-serge

> The reject file contains:
> 
> --- src/lxc/lxc-ps.in    2011-07-28 11:29:35.003183756 -0500
> +++ src/lxc/lxc-ps.in    2011-07-28 11:31:37.973180821 -0500
> @@ -121,11 +127,7 @@
>      my $container = <LXC>;
>      close LXC;
>      chomp($container);
> -    if ($container =~ m/[:,]ns[:,]/o) {
> -        $container =~ s/.*:\///o;
> -    } else {
> -    $container ='';
> -    }
> +    $container =~ s/.*:\///o;
>      return $container;
>  }
> 




More information about the lxc-users mailing list