[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Command run in the background (with '&' at the end) stil
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] Command run in the background (with '&' at the end) still runs even when the user exit from the login shell? |
Date: |
Fri, 13 Dec 2013 22:21:10 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 |
On 12/12/13, 5:53 PM, Peng Yu wrote:
> Hi,
>
> My previous impression was that processes run with '&' will be
> automatically terminated once the user logs out. But I just checked
> with the following example, it seems that these processes will
> continue to run until finished.
Bash introduced the `huponexit' shell option in bash-2.02, which was
released about 15 years ago. Before that, it would only pass a SIGHUP
it received through to its children (which it still does). I don't
know of any shells that killed background jobs at exit, but that doesn't
mean the kernel didn't SIGHUP jobs with the same controlling terminal
when a session leader exits.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/