parents and children

Doug Gwyn gwyn at smoke.ARPA
Sun Aug 21 06:31:15 AEST 1988


In article <39060 at linus.UUCP> jfjr at mitre-bedford.arpa (Freedman) writes:
>Are(is) the health of child processes connected to the
>health of the parent, ie if a process forks off another
>process and the parent process dies will the child continue
>to live? If so can I arrange that the child live on??

Processes don't "die".  They terminate either by invoking the exit
system call or as the default action for certain uncaught signals
posted to them (either self-generated or from another process via
the kill system call).

Termination of a parent process does not normally result in
generation of a signal, so the child is unaffected.  The only
circumstance under which a signal might be generated is when
some process such as one's login shell terminates causing a
SIGHUP to be sent to the process group associated with the
controlling terminal.  The details of this vary among UNIX
implementations.  If a process ignores SIGHUP it will be safe.
The "nohup" command can be used to spawn a process with
SIGHUP ignored, or a process can invoke signal(SIGHUP,SIG_IGN).



More information about the Comp.unix.questions mailing list