Which technique does the Unix system use to remove zombie processes whose parent has terminated?
When a process's parent dies, init (process 1) adopts the process. It will then reap adopted precesses that are or become zombies.
Reaping is normally done by the parent, as the parent needs to know when the child dies. It also has to stop the pid of the child being reused, until the parent knows, so that the parent does not signal the wrong process (signals the correct pid, but the pid now belongs to a new process.). In the reaping process the parent should forget about the child.
If a process terminates,and that process has children in the zombie state,the parents process ID of all the zombie children is set to 1(the init process) which will inherit the children and clean them up(i.e., init will wait for them,which removes the zombie).