名前空間で実際のPID 1をPID 1として使用する

名前空間で実際のPID 1をPID 1として使用する

Linux PID名前空間の場合、実際のP​​ID 1プロセス(同じ実行ファイルではない)はありますか?返品PID名前空間でPID 1として機能しますか?

ベストアンサー1

見えないman 7 pid_namespaces

The namespace init process
  The first process created in a new namespace (i.e., the process created
  using clone(2) with the CLONE_NEWPID flag, or the first  child  created
  by  a  process  after a call to unshare(2) using the CLONE_NEWPID flag)
  has the PID 1, and  is  the  "init"  process  for  the  namespace  (see
  init(1)).

新しいpid名前空間のプロセスは常に新しいプロセスで作成されるため、既存のプロセスを新しいpid名前空間のプロセスにすることはpid = 1できません。init

おすすめ記事