4.2 C Shell does *not* kill stopped jobs on logout.

idallen at watmath.UUCP idallen at watmath.UUCP
Fri Mar 29 18:20:32 AEST 1985


The C Shell does not kill stopped jobs on logout.  The 4.2bsd kernel does.

The 4.2bsd kernel SIGKILLs stopped jobs when their parents die.  Running
jobs are orphaned (inherited by INIT, process #1), but if an orphan
tries to SIGTSTP or stop because of SIGTTOU or SIGTTIN then it, too, will
be SIGKILLed by the kernel.

Compare:

   % stty tostop    # stop job if it tries tty output in background
   % set notify     # tell me about background job status ASAP
   % date &
   [1] 12345
   [1] Stopped (tty output)
   % ( date & )
   %

The date in the subshell produces no output, because it gets orphaned
when the subshell finishes spawning it, and when it tries to print on
your tty it tries to stop because of SIGTTOU, and the kernel kills it.
You can fix this (I did) so that background jobs of sub-shells ignore
SIGTTOU, and thus avoid the fascist behaviour of the kernel.
-- 
        -IAN!  (Ian! D. Allen)      University of Waterloo



More information about the Comp.unix.wizards mailing list