bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOF disowns background jobs?


From: Matthew Woehlke
Subject: Re: EOF disowns background jobs?
Date: Thu, 12 Mar 2009 10:29:15 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20090105 Fedora/2.0.0.19-1.fc10 Thunderbird/2.0.0.19 Mnenhy/0.7.5.0

Chet Ramey wrote:
Matthew Woehlke wrote:
$ some-command &
$ ^D
(bash exits, leaving some-command running)

Is this what is supposed to happen? Just asking because it made me go
"huh?"; I was expecting some-command to get SIGHUP'd.

Yes, that's what's supposed to happen.  How could you run daemons from
the command line otherwise?

"disown"?

What feels weird to me is that if the shell exits because of SIGHUP, that gets passed to children, but EOF doesn't do likewise.

This came up because closing terminal emulators will SIGHUP bash depending on how the TE exited, especially if it crashed, which then takes out non-disowned child processes (and there is similar cascade effect when e.g. an ssh session was running). EOF seems to be the "odd man out" in that children get to stick around without the user explicitly saying they should.

However, come to think of it the EOF behavior probably makes more sense for non-interactive shells... which throws the question back to the TE. I'm curious if you have an opinion; should a TE send EOF or SIGHUP when exiting normally but forcefully (i.e. user clicks the WM 'close window' button or uses File->Exit)?

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
ヱルキ・マーチウ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]