From: J G Miller on
On Thu, 18 Mar 2010 04:25:07 +0000, Robert Riches wrote:

> In at least some cases, the orphaned background process is adopted by
> init.

Yes that is indeed what happens, especially if when does an

(exec process &)

command.

> I think in at least some cases, those file descriptors
> effectively get switched to /dev/null.

Exactly, stdin, stdout, and stderr are not closed by the process,
because if they were, all the other processes would be screaming.

It is the file descriptors pointing to them which get closed or
diverted.

> It may vary with shell, and any use of nohup and/or setsid.

Again, yes, there is a significant difference in the job control
in bash and tcsh. I think there is a possibility with bash,
the shell level may also be involved in whether or not a backgrounded
process dies when the parent closes, as when I tried starting a
background process in an xterm running bash and closing it, the
background process did not exit as sometimes happens.