Namespaces in operation, part 3: PID namespaces
Namespaces in operation, part 3: PID namespaces
Posted Jan 17, 2013 6:27 UTC (Thu) by bjencks (subscriber, #80303)Parent article: Namespaces in operation, part 3: PID namespaces
Also, is there any way to determine the namespace hierarchy? Inode numbers identify them, but don't specify their relationships.
Posted Jan 17, 2013 12:26 UTC (Thu)
by ebiederm (subscriber, #35028)
[Link]
That should cover most day to day cases.
Processes in pid namespaces can not escape so process nesting mirrors pid namespace nesting.
With the pid namespace file descriptors you can find can with care mount proc for each of the pid namespaces.
For a process with children you will need to look at something like start time to distinguish between them. A little tricky but it should be doable. Process with parents outside the pid namespace will report their parent pid as 0, so should be easy to find. Normally there will be only one.
Namespaces in operation, part 3: PID namespaces
Readlink on /proc/self reports your pid in the pid namespace of the proc mount.