[Lxc-users] CPU cgroup starts by itself

Goran Cetusic goran.cetusic at gmail.com
Thu Mar 15 15:18:48 UTC 2012


Found the culprit in...wait for it...rc.local!
Also, there are commands in /etc/bash.bashrc that reference the mounted
folders so an error pops up whenever you open bash:

/etc/bash.bashrc:   mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null
2>&1
/etc/bash.bashrc:   echo $$ > /dev/cgroup/cpu/user/$$/tasks
/etc/bash.bashrc:   echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release

/etc/rc.local:   mkdir -p /dev/cgroup/cpu
/etc/rc.local:   mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
/etc/rc.local:   mkdir -m 0777 /dev/cgroup/cpu/user
/etc/rc.local:   echo "/usr/local/sbin/cgroup_clean" >
/dev/cgroup/cpu/release_agent

This is really strange, any ideas why only the cpu group is mounted and in
such an unorthodox way?

Also, where does lxc-attach get its path for the tasks file?
I created a rootfs and configfile with the lxc-debian script in /lxc/imunes
and started the container with lxc-start -n imunes -f /lxc/imunes/config.
It works but I can't execute anything because of a wrong filepath:

# lxc-attach -n imunes /bin/bash
lxc-attach: No such file or directory - failed to open
'/cgroup//lxc/lxc/imunes/tasks'

The tasks file is in /cgroup/lxc/imunes/tasks - there's an extra /lxc
there, how do i remove it?
I applied the patches to enable lxc-attach.


On Thu, Mar 15, 2012 at 2:00 PM, Robert Kawecki <thewanderer at gim11.pl>wrote:

> Dnia 2012-03-15, czw o godzinie 13:44 +0100, Goran Cetusic pisze:
> > I have problems with starting containers in Linux Mint Debian Edition
> > because /dev/cgroup/cpu is mounted by itself.
>
> I'm on Debian and I've ever had only two things mount any cgroups:
> 1. /etc/fstab (but you said it's not it)
> 2. /etc/cgconfig.conf
>
> (but of course it's nothing that a `grep -d recurse $some_keyword /etc`
> wouldn't show)
>
> Actually, a properly configured mount in either of those should enable
> LXC to work. And how to troubleshoot this at runtime? Try umounting the
> previously mounted filesystem and just mount where you need it.
> Shouldn't you be adding some options like -o cpu,freezer , too? You need
> specific cgroups mounted (like freezer) for LXC - at least that was the
> case when I last tried it I think.
>
> Oh, and I find that symlinking /etc/mtab to /proc/mounts helps a lot
> when dealing with cgroups.
>
> Hope that helps!
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120315/f4f4a9c9/attachment.html>


More information about the lxc-users mailing list