librelist archives

« back to archive

Problem with Linux Mint and virtualizations like LXC (linux containers) and Linux-Vserver

Problem with Linux Mint and virtualizations like LXC (linux containers) and Linux-Vserver

From:
arjan
Date:
2013-08-08 @ 14:34
Hi,

Linux mint has this script in /etc/bash.bashrc:

if [ "$PS1" ] ; then
    mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
    echo $$ > /dev/cgroup/cpu/user/$$/tasks
    echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
fi

The reason for this entry is probably this:

http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html

However this causes a problem for virtualization solutions like Linux 
Containers (LXC) or Linux-Vserver.

Linux Containers expects cgroup to be mounted on /sys/fs/cgroup.
In Linux-Vserver the mount is called vserver and is by default on 
/dev/cgroup, but this is configurable.

If you comply to what these virtualisation solutions suggest, they will 
work, but in Linux Mint you will see an error every time you start the 
bash prompt:

bash: /dev/cgroup/cpu/user/4148/tasks: No such file or directory
bash: /dev/cgroup/cpu/user/4148/notify_on_release: No such file or 
directory

And every time you switch to root:

bash: echo: write error: No space left on device

Herbert Poetzl, of Linux-Vserver, suggested to make the distro mount 
cgroup subsystems early and configure util-vserver to use the very same 
mount points. I understand the reason, but I don't see how I should do 
this.

Linux Mint mounts /dev/cgroup/cpu on cgroup, which is only a single 
cgroup feature. What does Linux Mint exactly expect from this mount? Can 
I disable it? How to change it in a way that Linux Mint will not 
complain, and I can use all cgroup features for virtualisation?

Any tips would be appreciated.

Kind regards,
Arjan Widlak.

-- 
Met vriendelijke groet,
Arjan Widlak

Bezoek onze site op:
http://www.unitedknowledge.nl

De rijkshuisstijl, ook voor tablet en iPhone:
http://www.rijkshuisstijl.unitedknowledge.nl/

United Knowledge, inhoud en techniek
Bilderdijkstraat 79N
1053 KM Amsterdam
T +31 (0)20 737 1851
F +31 (0)84 877 0399
bureau@unitedknowledge.nl
http://www.unitedknowledge.nl

M +31 (0)6 2427 1444
E arjan@unitedknowledge.nl

We use WebGUI, the Open Source CMS
http://www.webgui.org/

Re: [linuxmint] Problem with Linux Mint and virtualizations like LXC (linux containers) and Linux-Vserver

From:
Arjan Widlak
Date:
2013-08-08 @ 21:47
Hi,

Let me phrase the question differently.
/etc/bash.bashrc is executed for all users.
In LMDE Cinnamon Edition, in bash.bashrc is:

if [ "$PS1" ] ; then
    mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
    echo $$ > /dev/cgroup/cpu/user/$$/tasks
    echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
fi

If I comment this out, there is no problem when installing util-vserver 
(needed for Linux-VServer) anymore. Nor is there any problem putting in 
fstab "cgroup /sys/fs/cgroup" for lxc (linux containers). And no errors 
appear when starting bash.

I suppose the reason the code above is in bash.bashrc is because of 
improved performance under strain as explained here:
http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html

I hoped there would be anybody who could integrate both for each of 
these frequently used visualization solutions.

Kind regards,
Arjan Widlak.



On 08/08/2013 04:34 PM, arjan wrote:
> Hi,
>
> Linux mint has this script in /etc/bash.bashrc:
>
> if [ "$PS1" ] ; then
>      mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
>      echo $$ > /dev/cgroup/cpu/user/$$/tasks
>      echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
> fi
>
> The reason for this entry is probably this:
>
> http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html
>
> However this causes a problem for virtualization solutions like Linux
> Containers (LXC) or Linux-Vserver.
>
> Linux Containers expects cgroup to be mounted on /sys/fs/cgroup.
> In Linux-Vserver the mount is called vserver and is by default on
> /dev/cgroup, but this is configurable.
>
> If you comply to what these virtualisation solutions suggest, they will
> work, but in Linux Mint you will see an error every time you start the
> bash prompt:
>
> bash: /dev/cgroup/cpu/user/4148/tasks: No such file or directory
> bash: /dev/cgroup/cpu/user/4148/notify_on_release: No such file or
> directory
>
> And every time you switch to root:
>
> bash: echo: write error: No space left on device
>
> Herbert Poetzl, of Linux-Vserver, suggested to make the distro mount
> cgroup subsystems early and configure util-vserver to use the very same
> mount points. I understand the reason, but I don't see how I should do
> this.
>
> Linux Mint mounts /dev/cgroup/cpu on cgroup, which is only a single
> cgroup feature. What does Linux Mint exactly expect from this mount? Can
> I disable it? How to change it in a way that Linux Mint will not
> complain, and I can use all cgroup features for virtualisation?
>
> Any tips would be appreciated.
>
> Kind regards,
> Arjan Widlak.
>

Re: [linuxmint] Problem with Linux Mint and virtualizations like LXC (linux containers) and Linux-Vserver

From:
Doug Lytle
Date:
2013-08-08 @ 16:09
>> Linux mint has this script in /etc/bash.bashrc:

I'm not seeing this in Mint 14 or 15 on a 32bit KDE platform.

Doug

Re: [linuxmint] Problem with Linux Mint and virtualizations like LXC (linux containers) and Linux-Vserver

From:
arjan
Date:
2013-08-08 @ 20:08
Hi,

I'm using LMDE 201303 Cinnamon Edition.
What do you see if you enter:
$ mount

Do you see this:
cgroup /dev/cgroups/cpu

Kind regards,
Arjan Widlak.

On 08/08/2013 06:09 PM, Doug Lytle wrote:
>>> Linux mint has this script in /etc/bash.bashrc:
> I'm not seeing this in Mint 14 or 15 on a 32bit KDE platform.
>
> Doug


-- 
Met vriendelijke groet,
Arjan Widlak

Bezoek onze site op:
http://www.unitedknowledge.nl

De rijkshuisstijl, ook voor tablet en iPhone:
http://www.rijkshuisstijl.unitedknowledge.nl/

United Knowledge, inhoud en techniek
Bilderdijkstraat 79N
1053 KM Amsterdam
T +31 (0)20 737 1851
F +31 (0)84 877 0399
bureau@unitedknowledge.nl
http://www.unitedknowledge.nl

M +31 (0)6 2427 1444
E arjan@unitedknowledge.nl

We use WebGUI, the Open Source CMS
http://www.webgui.org/

Re: [linuxmint] Problem with Linux Mint and virtualizations like LXC (linux containers) and Linux-Vserver

From:
Doug Lytle
Date:
2013-08-08 @ 20:29
>> Do you see this:
>> cgroup /dev/cgroups/cpu

Under Mint 14, I get nothing, Under 15 I get:

mount|grep -i cgroup
none on /sys/fs/cgroup type tmpfs (rw)

And, under /etc/mtab I have an entry:

none /sys/fs/cgroup tmpfs rw 0 0

Doug