Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14956

Re: Terminating background bash kills the parent?

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Terminating background bash kills the parent?
Date 2018-12-26 11:42 -0500
Organization ITS, Case Western Reserve University
Message-ID <mailman.6316.1545842530.1284.bug-bash@gnu.org> (permalink)
References <CAFra36j2V0L877o4X9XbcoOrJXfZegResBpqPeH61_kM+QWiAg@mail.gmail.com>

Show all headers | View raw


On 12/20/18 12:02 AM, Bize Ma wrote:
> Open a new terminal like xterm, change prompt to something like:
> 
>     PS1=' $SHLVL $ '
> 
> Start a couple of bash subshells:
> 
>     1 $ bash
>     2 $ bash
>     3 $ echo $$
>     9371
> 
> Suspend the last one:
> 
>     3 $ suspend
>     [1]+ Stopped                 bash
>     2 $ echo $$
>     9313
>     2 $
> 
> Make the suspended shell continue:
> 
>     2 $ kill -CONT 9371
>  
> The parent gets killed
> 
>     1 $ echo $$
>     9034
>      1 $

The terminal ends up in the wrong process group, and the parent shell can't
do anything about it. You either get EOF on stdin, -1/EIO on the read, or a
SIGHUP.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Terminating background bash kills the parent? Chet Ramey <chet.ramey@case.edu> - 2018-12-26 11:42 -0500

csiph-web