Problem with fork

Bryan Castillo rook_5150 at
Mon Oct 21 22:46:55 CEST 2002

This is a *nix question.

> There is something I don't understand. I've create simple program below in
> my Linux:
> import os, sys, time

import signal

> if os.fork(): sys.exit()
> os.setsid()

signal.signal(signal.SIGCHLD, signal.SIG_IGN)

> for child in range(10):


> Parent creates 10 childs in sequence by fork. It works ...
> But, everytime the child process exits, it leaves <defunct> in my process
> status.

Look up man pages for wait(2) waitpid(2) and signal2)

More information about the Python-list mailing list