PDA

View Full Version : Mount cgroup at boot...



sup3rior
28-Apr-2012, 16:45
Hi,

Trying to setup LXC on a SLES 11 which is working as far as I've gotten at the moment. One thing keeps eluding me however, and that is having cgroups mount at boot.

Have added a line to /etc/fstab that reads:

none /cgroup cgroup defaults 0 0

But at boot, it isn't mounted. Running mount manually (as root) with this command works fine:

mount none -t cgroup /cgroup

Any suggestions?

Regards,
Anders

malcolmlewis
28-Apr-2012, 17:20
Hi,

Trying to setup LXC on a SLES 11 which is working as far as I've gotten
at the moment. One thing keeps eluding me however, and that is having
cgroups mount at boot.

Have added a line to /etc/fstab that reads:

none /cgroup cgroup defaults 0 0

But at boot, it isn't mounted. Running mount manually (as root) with
this command works fine:

mount none -t cgroup /cgroup

Any suggestions?

Regards,
Anders



Hi
On openSUSE running cgroups it's mounted as tmpfs;


tmpfs /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0

What is the output from the mount command after you manually mount?

Have a browse here;
http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt

--
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.1 (x86_64) Kernel 3.1.10-1.9-desktop
up 2:44, 3 users, load average: 0.01, 0.02, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

sup3rior
30-Apr-2012, 11:42
Hi
On openSUSE running cgroups it's mounted as tmpfs;


tmpfs /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0

What is the output from the mount command after you manually mount?

Have a browse here;
http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt


Not to strong on SLES yet, but one thing that pops in mind with your post is that I don't need it to mount it as tmpfs but as cgroup:


mount -t none cgroup /cgroup

Don't know if there is any difference between SLES and OpenSuse on this part but since I am to use this for running LXC the available documentation for this states that mount point. On the part of mounting this at boot, I've only been able to find documentation for either Red Hat or Ubuntu which tells to add the command to etc/fstab so I was hoping that the same command would work on SLES (which it apparently didn't).

On the subject of output from running the command manually, it doesn't give any. I run the command as root, no output is given but when starting my LXC container it no longer whines about cgroups not being mounted. Hence my comment that it seems to be working when running it manually.

Regards,
Anders

enovaklbank
09-May-2012, 14:04
Is boot.cgroup enabled on your SLES box?

Check it's start) section. It first checks and mounts /sys/fs/cgroup with
mount -t tmpfs tmpfs -o mode=755,nosuid,nodev,noexec /sys/fs/cgroup
and then the subfolders
mount -t cgroup -o nosuid,nodev,noexec,$name cgroup "$d"

Maybe you only need to enable this script in order to work.

> Don't know if there is any difference between SLES and OpenSuse on this part
There are a lot... opensuse 12.1 uses Systemd, while SLES uses sysvinit, for example.

Magic31
14-May-2012, 09:25
> Don't know if there is any difference between SLES and OpenSuse on this part
There are a lot... opensuse 12.1 uses Systemd, while SLES uses sysvinit, for example.

And cgroups are only available/supported on SLES 11 starting SP2 IIRC?

update: scratch that, it's containers LXC itself I was thinking of... Monday mornings... :P

Cheers,
Willem