csh and SIGHUP, POSIX and BSD
Mark Brown
mbrown at testsys.austin.ibm.com
Fri Apr 5 09:32:29 AEST 1991
I'm a little puzzled by the behavior of my csh, so I'm presenting the
"Case Of The Orphaned Vi" to this august body.
The problem:
ATT-based system, POSIX line discipline.
1. connect via telnet. execute vi from csh (login shell), then escape
to telnet and quit. [vi is in the foreground process group, csh is
the controlling process, but is in a background process group).
2. the terminal disconnect is detected and responded to, the SIGHUP is
sent to the controlling process associated with the terminal.
3. csh apparently receives the SIGHUP, responds. It puts itself in
foreground and exits.
4. vi is now in a background process group and is orphaned.
NOTES:
a) In the BSD line discipline, the 'foreground process group' (vi) gets the
HUP, vi dies, the csh exits.
b) In POSIX line discipline, the HUP goes to the 'session-group-leader'
(csh), with the above results.
c) ksh, in POSIX discipline, in the above situation, gets the HUP and
sends_the_HUP_to_the_foreground_process_group before it dies. It doesn't
move itself to the foreground.
QUESTIONS:
x) Is the csh broken badly, because it goes to foreground?
y) Is it broken to make csh work like ksh does, here?
--
Mark Brown
MAIL: mbrown at testsys.austin.ibm.com OR uunet!testsys.austin.ibm.com!mbrown
Which came first: The Chicken or the Legba?
DISCLAIMER: Any personal opinions stated here are just that.
More information about the Comp.unix.wizards
mailing list