Ok - I think I see your confusion. As far as I know, there is no connection between file descriptiors and signals. Meaning, the fact that you close redirect your STDIN/STDERR in your script doesn't stop the shell from sending you a SIGHUP when the parent exits. You have to disassociate yourself from your parent process, which is what the
setsid call does (I think).
-- Dan