[CRIU] How can I get "real pid" in pid namespace?

Chanho Park chanho61.park at samsusng.com
Sun Jun 30 18:27:18 EDT 2013


Hi,

If we start pid_namespace with CLONE_NEWPID, the process will have virtual
pid.
Even it can be started from 1. The process can get the pid using getpid().
If it is in the pid namespace, it only returns virtual pid.

However, many legacy application exports its pid
and send it to other processes to identify the process.
Other processes can identify the process from real pid not vpid.

I know the behavior is not suitable for the purpose of container.
I think if the virtual pid is exported to out of namespace,
it should be converted to the real pid.

How can the process get "real pid" in the pid namespace?

Best Regards,
Chanho Park



More information about the CRIU mailing list