孤儿进程: 即一个其父进程已经终止的进程。 孤儿进程由 init 进程“收养”,init 进程ID为1,因此被收养的孤儿进程的父进程便更新为1。转载请尊重原创、保留相关链接本文来自多宝平台:http://www.mbodb.com
孤儿进程组: 一个进程组中的所有进程的父进程要么是该进程组的一个进程,要么不是该进程组所在的会话中的进程。 一个进程组不是孤儿进程组的条件是,该组中有一个进程其父进程在属于同一个会话的另一个组中。
GNU解释了为什么会提出孤儿进程组的概念:
When a controlling process terminates, its terminal becomes free and a new session can be established on it. (In fact, another user could log in on the terminal.) This could cause a problem if any processes from the old session are still trying to use that terminal.
To prevent problems, process groups that continue running even after the session leader has terminated are marked as orphaned process groups.