Sun child termination.

Chris Torek chris at mimsy.UUCP
Sun Sep 18 18:54:08 AEST 1988


In article <347 at intelisc.UUCP> joel at intelisc.UUCP (Joel Clark) writes:
>On a Sun 3/50 running Sun OS 3.5 the [orphaned] child program terminates
>with no message, at the read on stdin, as soon the parent terminates.  If
>the child does not read stdin, it survives.

This happens only if the child's stdin is a tty and SIGTTIN is enabled
(this is the default) and the process is started by a shell that
understands job control.  The child is in a separate process group, and
its parent process is /etc/init (pid 1), since it has been orphaned.
When it tries to read from a terminal, the tty driver code notices that
it is not in the proper process group and sends a SIGTTIN (`stop on tty
input') signal so that the ultimate parent shell can take note.  Alas,
there is no shell; the process is a child of init, and the signal code
refuses to allow children of init to stop on keyboard signals, since
no one is around to continue them.  So the kernel translates the SIGTTIN
to a SIGKILL, and kills the process.

This is arguably the wrong thing to do, but then, there is not much
that is arguably the *right* thing to do in such a situation.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list