[Devel] Re: container userspace tools

Ian jonhson jonhson.ian at gmail.com
Fri Dec 12 02:02:22 PST 2008


>
> OK, so this is not an lxc kernel, but a mainline kernel.
>

So, what is the lxc kernel you meat? Is it different from the
2.6.27-rc8. I use that version  recommended by Daniel.

>>
>> > 1. Can you see the memory.usage_in_bytes corresponding to the control
>> > group where you run the container
>>
>> How can I know the number correspond to the control group?
>
> From outside the container, figure out the process id of init and then
> do a cat /proc/<pid>/cgroup. Then go to that directory and cat
> memory.usage_in_bytes, memory.stat and memory.limit_in_bytes to verify
> the setup
>

OK, I have done the checking, but I don't understand what is meaning of
"corresponding". The content is shown as follows:

$ cat /proc/4506/cgroup
255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/
$ cat memory.usage_in_bytes
223932416


>>
>> > 2. Check tasks file to see that the container tasks are indeed in the
>> > container.
>> >
>>
>> My program forks a child and its child (grandson of previous process) call the
>> the /bin/bash to open a shell. I just can find the parent process is
>> in container
>> tasks file, but its child and grandson process are not.
>>
>
> Hmmm.. but the child and grandson are alive right?
yes... I can see them by a container-outside bash running with ps

> Do a cat
> /proc/<pid>/cgroup on them to see where they went or where they are.
>

They are all there, similar with pid=4506.

$ cat /proc/4506/cgroup
255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/
$ cat /proc/4507/cgroup
255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/4507
$ cat /proc/4508/cgroup
255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/4506


Any idea?
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list