in reply to Detached forking in a CGI script

In order to let the parent exit and the child survive (i.e. Not zombifying), you need to do a double fork.

Read this up until the end, where the crucial information is given about the double fork:

http://world.std.com/~swmcd/steven/tech/daemon.html

Edit:

That was from a daemon point of view. Found the exact code I wanted to show you:

Search for "double fork approach" in this:

http://perl.apache.org/docs/1.0/guide/performance.html#Avoiding_Zombie_Processes