SIGCHLD, fork, listen

bill bill at rfa.org
Thu Sep 23 08:35:16 EDT 1999


I'm trying to set up a fairly "simple"
server that listens for a socket connection,
forks off a process and goes back to listening.
This works fine for multiple clients, except
I get zombies.  I try redefining SIGCHLD as
SIG_IGN, but this doesn't work (as apparently
is what's expected under POSIX).  I then
try redefining it with my own function that
includes a WAIT.  Fine, except "listen"
doesn't get signalled when the child process
dies, only when the next socket connection
occurs.  (which could be hours later, not
good).

So is there a simple way to get around all this?
A higher piercing SIG to get through to "listen"?
A different flag?  I split this out into 4
servers before to get around this, but it's
kind of ugly/wasteful.

Thanks,
Bill

--
Bill Eldridge
Radio Free Asia
bill at hk.rfa.org





More information about the Python-list mailing list