[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash doesn't send SIGHUP to children
From: |
Emil |
Subject: |
Re: bash doesn't send SIGHUP to children |
Date: |
Thu, 11 Sep 2008 21:21:34 +0100 |
On 11 September 2008, Chet Ramey <chet.ramey@case.edu> wrote:
> > On 4 September 2008, Chet Ramey <chet.ramey@case.edu> wrote:
> > > > Description:
> > > > Regradless of the huponexit setting ('shopt -s huponexit'
> > > > doesn't
> > > > help) bash does not send SIGHUP to its children when it
> > > > receives one
> > > > itself. Previous version of bash 3.1.17 was behaving properly
> > > > even with huponexit set to off
> > > >
> > > > Repeat-By:
> > > > launch rxvt, launch mc then close the rxvt window ->
> > > > mc is still running with CPU to 100% (this is because
> > > > mc tries to read from stdin while receiving EOF)
> > > > Closing rxvt sends SIGHUP to bash but bash doesn't send
> > > > SIGHUP to its children
>
> I can't reproduce what you're seeing. Here's what I get:
>
> [...]
>
> I am wondering about a few things from your trace. First, why is bash
> reading from fd 3? That implies a non-interactive shell, possibly without
> job control. The `huponexit' option only works with interactive login
> shells. The SIGHUP handler only resends SIGHUP to jobs when the shell is
> interactive -- it's often not the right thing to send them to all children
> when the shell is not interactive.
Hi Chet,
Bash runs interactive.
After some further investigation it turned out that you also need to use
a function in your bash scripts to reproduce the bug.
I have the following in my .bashrc
mc () { MC=`/usr/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC; }
This was the recommended way for mc to 'remember' the directory you've last
visited when you exited mc.
Anyways something changed in bash behaviour between version 3.1.17 and 3.2.39
Only by swappwing the two versions and without touching any configuration files
the SIGHUP is delivered or not.
--
Regards,
Emil
--
I was on a date recently, and the guy took me horsebackriding.
That was kind of fun, until we ran out of quarters.