[lxc-devel] PID of a process inside an lxc container

Christian Brauner christian.brauner at mailbox.org
Wed Feb 3 15:33:02 UTC 2016


On Wed, Feb 03, 2016 at 04:49:04PM +0200, Kevin Wilson wrote:
> Hi,
> 
> When I create an lxc container and run a simple process (which all it
> does is call pause()),
> I see the pid of this process also in the host (Simply by running ps
> aux | grep pause).
> And of course I see it also inside the container again with ps aux | grep pause.
> The pids are of course different.
> 
> What is the reason for this ? I would expect that
> since the conatiner has a different PID namespace, the PID whic is
> created for the child
> will no be seen on the host, which acts in a different namespace (the
> initial PID namespace)
The reason is that this is how PID namespace are designed: They form a tree up
to the root namespace. Each process will have *a* PID in which it was created up
to the root namespace.


More information about the lxc-devel mailing list