qn on zombie processes

if the signal handler of SIGCHLD is set to SIG_IGN, then if I fork a process and the parent terminates before the child, will the child still become a zombie process after it terminates?
Last edited on
If a parent dies first, it will be re-parent to "init" process. so after your child process getting terminated init will take care of waiting and cleaning up.

so yours will not become a zombie




Last edited on
anyone else?
This is palpable.

If you want proof, it is there in Richard stevens Advanced Programming in the UNIX.

You want more proof, print the ppid of daemon process and find how to make a process daemon.

+1 srina....

All processes in unix have parents. If the parent dies, the child is reparented up the process tree, in this case to init.
then in what circumstances are zombies or orphan processes created?
closed account (z05DSL3A)
then in what circumstances are zombies or orphan processes created?

zombie processes (or defunct process) are processes that have finished have finished execution but stiff have an entry in the process table. It will stay a zombie until the parent makes the wait system call often from the parents SIGCHLD signal handler.

If a parent process dies before the child the child is orphaned and is looked after by the "init" process. When the init process receives a SIGCHLD signal it cleans up.
Topic archived. No new replies allowed.