Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!pyramid!hplabs!hpda!hpcupt1!davel
From: davel@hpcupt1.HP.COM (Dave Lennert)
Newsgroups: comp.unix.wizards
Subject: Re: signal handling,c-shell,hp840
Message-ID: <5960001@hpcupt1.HP.COM>
Date: 16 Dec 87 22:27:56 GMT
References: <7649@eddie.MIT.EDU>
Organization: Hewlett Packard, Cupertino
Lines: 25

> The child, foo, is not actually terminated if foo.csh exits.  It catches
> the SIGINT signal and continues to run in the background, but does not
> see further break or intr characters from the keyboard because it is in
> another process group from the interactive shell.  You can still send it
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      true on the 840 because it supports job control

> SIGINT signals with the kill command.
> 
> Mike Stroyan, [hplabs!]hpfcla!stroyan

This is correct.  However, since the 840 supports job control, there is
an additional worry:  

When foo.csh exits (and foo continues to execute), the parent of foo.csh
continues.  If this parent is a csh, then it places itself into the
foreground and, hence, foo in the background.  If an orphaned background
process (foo, in this case) attempts to access the terminal, it will
stop and be killed by the kernel (SIGKILL).  This means that it will
silently terminate.  You can get around this, at least in the case of
write(), by either clearing the LTOSTOP bit (stty -tostop), which allows
write() for *all* background processes, or by setting SIGTTOU to SIG_IGN
in foo, which effects just foo.

-Dave Lennert   HP   ihnp4!hplabs!hpda!davel