[Users] Docker inside Openvz CT: equivalent to systemd params under sysv init?

Kir Kolyshkin kir at openvz.org
Tue May 26 13:42:01 PDT 2015



On 05/24/2015 03:47 AM, Benjamin Henrion wrote:
> Hi,
>
> I am trying to make this work:
>
> https://openvz.org/Docker_inside_CT
>
> It mentions:
>
> ====================================
> "Configure custom cgroups in systemd:"
>
> systemd reads /proc/cgroups and mounts all cgroups enabled there,
> though it doesn't know there's a restriction that only freezer,devices
> and cpuacct,cpu,cpuset can be mounted in container, but not freezer,
> cpu etc. separately
> vzctl mount $veid
> echo "JoinControllers=cpu,cpuacct,cpuset freezer,devices" >>
> /vz/root/$veid/etc/systemd/system.conf
> ====================================
>
> I am trying to make it work with a Debian Wheezy CT without systemd,
> any idea how to do the same with the old sysvinit?


Something like this should do:

# mount -t tmpfs tmpfs /sys/fs/cgroup
# mkdir /sys/fs/cgroup/freezer,devices
# mount -t cgroup cgroup /sys/fs/cgroup/freezer,devices -o freezer,devices
# mkdir /sys/fs/cgroup/cpu,cpuacct,cpuset
# mount -t cgroup cgroup /sys/fs/cgroup/cpu,cpuacct,cpuset/ -o 
cpu,cpuacct,cpuset

(Surely, this can be put into /etc/fstab to make it permanent)

Note, some other cgroup mounts can be needed, too (memory, blkio).

>
> Otherwise I am hitting that error in the docker daemon log:
>
> ====================================
> ERRO[0040] Handler for POST /containers/{name:.*}/start returned
> error: Cannot start container
> 197ffe32571575340ec3f399349d62c42818bb9c2a45656bfaafc22c68a55055: [8]
> System error: mountpoint for cpu not found
> ERRO[0040] HTTP Error: statusCode=500 Cannot start container
> 197ffe32571575340ec3f399349d62c42818bb9c2a45656bfaafc22c68a55055: [8]
> System error: mountpoint for cpu not found
> ====================================
>
> Best,
>
> --
> Benjamin Henrion <bhenrion at ffii.org>
> FFII Brussels - +32-484-566109 - +32-2-4148403
> "In July 2005, after several failed attempts to legalise software
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of
> software, they are now seeking to create a central European patent
> court, which would establish and enforce patentability rules in their
> favor, without any possibility of correction by competing courts or
> democratically elected legislators."
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://lists.openvz.org/mailman/listinfo/users



More information about the Users mailing list