HUP doesn't send to processes when logout

平天韩 hanpingtian at gmail.com
Wed Dec 31 03:20:30 UTC 2008


> Because while a logout doesn't send a HUP unless huponexit is set, it
> DOES send a TERM signal which should terminate child processes.  You

No. It seems if I didn't set huponexit, logout won't send either "HUP" or
"TERM" to the background process. The process will keep running, like a
daemon after the logout. But if I set the huponexit, logout will kill the
background process with some other signals, they are not HUP or
TERM.

If I sent HUP to the session leader of the control terminal (the bash
I think, and
it didn't set huponexit), the bash will quit. Before that, the bash
will first send
HUP to the background process and then send another signal other than
TERM to kill it.

I think the "HUP" means the terminal maybe broken, so bash will signal
each of its child to
quit. But only logout it won't signal children.

> need to trap that signal as well or use a "disown" on the PID of the
> child process to disassociate it from the login shell.

Thank you for pointing out the "disown".




More information about the fedora-list mailing list