The only time that httpd kills the script is if it times out
(ScriptTimeOut directive if I recall). It then first sends TERM,
waits 5 seconds, and then sends KILL.
If the client has disconnected from the server, then the server will
catch SIGPIPE when it's doing the next write to the socket, and exit.
It doesn't send a signal to the script then, but leaves the script
running (maybe this could be thought of as a bug, too).
If you want to be sure that your CGI script is unaffected by kills, do
an extra fork to obtain a new pid so the server can't send it TERM and
KILL.
-- Cheers, Ari --