[lxc-devel] A question about lxc

Daniel Lezcano daniel.lezcano at free.fr
Thu Jul 2 08:51:50 UTC 2009


Gui Jianfeng wrote:
> Hi Daniel,
>
> I tried lxc and have A question about lxc
>
> I successfully built lxc in my box, and i played with
> it as following.
>
> #lxc-create -n foo
> #lxc-execute -n foo /bin/bash
> #lxc-ps -n foo
>
> Then, I got the following error:
>
> cat: /usr/local/var/lib/lxc/foo/nsgroup/tasks: No such file or directory
> ERROR: List of process IDs must follow -p.
>
> I checked the code, IMHO, "/usr/local/var/lib/lxc/foo/nsgroup" should link
> to the corresponding Cgroup directory. But i can't find out which part of 
> the code takes care of creating Cgroup directory.
>
> Would you explain this a bit?
>   

Hi Gui,

lxc does not create the cgroup directory, it is automatically created 
when a namespace is created, this is a feature of the ns_cgroup. It is 
probable you mounted the cgroup without the "ns" option or the feature 
is not enabled in the kernel.

There is a tool to check the kernel configuration : lxc-checkconfig; it 
should give you some informations about the kernel config.
You should see something like that:

--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup namespace: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: disabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled


If you have a custom kernel, you should specify the config location like:

CONFIG=<path_to_my_config> lxc-checkconfig

Cheers
  -- Daniel




More information about the lxc-devel mailing list