Okay, in user space, unless there's some requirement that the process actually have a controlling terminal, ignoring SIGHUP is enough. If it does need a controlling terminal, then it's unlikely to be running as a daemon anyway.

The proper way to write a program to do this sort of thing itself is to have the child after a fork call setsid(). setpgrp() does the same thing, more or less, but has been deprecated in favor of setsid(). You can close FDs 0, 1, and 2 if you want, but it's hardly required.

But, as far as I know, there only way to prevent a child from dying when his parent exits that wants to do so without rewriting the application is to use nohup. And it definitely doesn't close the controlling terminal, as it write's the process's output to nohup.out.
_________________________
Bitt Faulk