Re: unfinished command executed when TTY is closed
From:
Chet Ramey
Subject:
Re: unfinished command executed when TTY is closed
Date:
Thu, 18 Dec 2014 12:01:49 -0500
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
On 12/18/14, 11:22 AM, Jiri Kukacka wrote:
> I checked what's going on using truss, and here's what is says (just the
> interesting part):
> 1197: read(0, " r", 1) = 1
> 1197: lwp_sigmask(SIG_SETMASK, 0x00000002, 0x00000000, 0x00000000,
> 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
> 1197: write(2, " r", 1) = 1
> 1197: lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000, 0x00000000,
> 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
> 1197: read(0, " e", 1) = 1
> 1197: lwp_sigmask(SIG_SETMASK, 0x00000002, 0x00000000, 0x00000000,
> 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
> 1197: write(2, " e", 1) = 1
> 1197: lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000, 0x00000000,
> 0x00000000) = 0xFFBFFEFF [0xFFFFFFFF]
> 1197: read(0, 0xFFFF80D532B7FE8C, 1) (sleeping...)
> 1197: read(0, 0xFFFF80D532B7FE8C, 1) = 0
> 1197: write(2, "\n", 1) Err#5 EIO
OK, this is the problem part. This looks like a bug in Solaris. There's
no indication that the kernel sent SIGHUP before changing the behavior of
read and write upon disconnect.
Can you see whether or not the first bash in the chain gets a SIGHUP here?
(Though I can't see why or how sending a SIGHUP to any process other than
the tty's current foreground process group is useful.)
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/