Quote:
|
by the time the parent terminates, if there are child processes already terminated and still running, init will adopt the running ones
|
Init will adopt only those processes for which there is no parent process that is currently alive (or a slot in the process table entry) is no more, but in your case, child has exited first and it enters zombie state for the parent to collect the status of the created child process. Since the parent process of the child is alive very much ( in sleep mode ) init cannot adopt that, and once the parent process terminates, child stats is collected and there is no need for the child process to remain as zombie and it becomes completely relieved.