Date: Thu, 19 Apr 2001 10:59:57 +0300 From: Peter Pentchev <roam@orbitel.bg> To: questions@FreeBSD.org Subject: Re: A real stupid-like sessions / group leaders / shells question Message-ID: <20010419105957.C3605@ringworld.oblivion.bg> In-Reply-To: <20010418210622.A2272@ringworld.oblivion.bg>; from roam@orbitel.bg on Wed, Apr 18, 2001 at 09:06:22PM %2B0300 References: <20010418210622.A2272@ringworld.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 18, 2001 at 09:06:22PM +0300, Peter Pentchev wrote: > OK, so this might be really really really stupid, but.. > [snip] > > I somewhat fail to see why a 'bg' of a child process should kill the parent > shell.. I can reproduce this with various combinations of csh, tcsh and bash > as either the login or the child shells. csh/tcsh is the one from today's > -stable, bash is 2.05 from ports. Alright, I think I got it.. I'm not quite sure that tcsh is DTRT, though.. After sprinkling printf()'s all over kill() and killpg1() in kern_sig.c, I got the following: FreeBSD 4.3-RC (RINGWORLD) #56: Thu Apr 19 00:56:15 EEST 2001 This is a MOTD. Live with it. [roam@ringworld:v0 ~]$ tcsh > kill -STOP $$ RDBG kill: psignal 17 to [1139] tcsh [1]+ Stopped tcsh [roam@ringworld:v0 ~]$ bg [1]+ tcsh & RDBG kill: broadcast 19 from [1127 bash] to [-1139] RDBG killpg1_2: psignal 19 to [1139] tcsh [roam@ringworld:v0 ~]$ > RDBG kill: broadcast 1 from [1139 tcsh] to [-1127] RDBG killpg1_2: psignal 1 to [1127] bash RDBG kill: broadcast 1 from [1127 bash] to [-1139] RDBG killpg1_2: psignal 1 to [1139] tcsh RDBG kill: psignal 1 to [1127] bash FreeBSD/i386 (ringworld.oblivion.bg) (ttyv0) login: Then, a ktrace revealed that tcsh, after receiving a SIGCONT and outputting the '>' prompt (just after psignal 19 to [1139]), gets a EIO on read() (quite normal, it's been backgrounded, it has no stdin), and then it happily proceeds to hup its parent process :) Sweet.. but why? :) G'luck, Peter -- If I had finished this sentence, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010419105957.C3605>