[lxc-devel] Erroneous "cgroup is not mounted" when using cgconfig (libcgroup)

Daniel Lezcano daniel.lezcano at free.fr
Mon Oct 4 10:56:11 UTC 2010


On 10/03/2010 05:06 PM, Ward, David - 0663 - MITLL wrote:
> The 'cgconfig' tool from libcgroup (http://libcg.sourceforge.net) can be used to mount one or more instances of the cgroup virtual filesystem, instead of using the 'mount' command.  However, cgconfig does not update /etc/mtab, although the mounted cgroup filesystems do appear in /proc/mounts.  (I am using Fedora 13.)
>
> Since lxc commands such as 'lxc-execute' just search /etc/mtab to see if any cgroup filesystem is mounted, this causes them to fail with "cgroup is not mounted", even though this is not the case.
>
> It seems to me that either:
>    1) cgconfig should update /etc/mtab, or
>    2) lxc should search /proc/mounts instead of /etc/mtab
>       (change one line in src/lxc/cgroup.c)
>
> Which is the correct solution?
>    

The /etc/mtab belongs to the 'mount' command. I don't know libcg well 
but I don't think it should mount the cgroup. That should be up to the 
package's post-install script to add the mount point in the fstab and 
let the system do its job when it starts. That does not prevent the 
cgconfig to update the fstab instead of mounting things in the back of 
the administrator.
As the location of the fstab can be different depending of the distro, 
that would makes sense to have the distro package script to update the 
fstab ...

Solution (2) is correct because /etc/mtab is less reliable than 
/proc/mounts.

Thanks
   -- Daniel






More information about the lxc-devel mailing list