Background process and SIGHUP
Posted
by
Charles Salvia
on Super User
See other posts from Super User
or by Charles Salvia
Published on 2011-01-07T23:32:22Z
Indexed on
2011/01/07
23:56 UTC
Read the original article
Hit count: 244
My understanding is that a program that is associated with a terminal will receive the SIGHUP signal if that terminal is closed. This usually will terminate the program.
I also know that you can use the nohup
command along with the &
symbol to run the program in the background, and disassociate it from the terminal so that the program is not terminated when the terminal closes (on log out.)
However, suppose a program is run normally without nohup
, but is then suspended using Cntl-Z. If the program is then resumed in the background using the bg
command, will it receive the SIGHUP signal on log out?
Or to put it another way: if I have a program which is already running, and I don't want to stop it but I'd like to log out, can I suspend it using Cntl-Z and run it in the background using bg
? Or will the program be terminated when I log out?
© Super User or respective owner