From gnome-terminal I know the ability to suspend a job with C-z, and then send it to the background. When I close the terminal the process does not end. Where is the job being managed from, or is it lost?
Shell – Where do background jobs go
background-processjob-controljobsshell
Best Answer
Your background job continues executing until someone tells it to stop by sending it a signal. There are several ways it might die:
If your concern is to keep the program running, then:
nohup
command (nohup myprogram --option somearg
), which ensures that the shell won't send it a SIGHUP, redirects standard input to/dev/null
and redirects standard output and standard error to a file callednohup.out
.disown
built-in, if your shell has one. If it doesn't, you can avoid the shell's propagation of SIGHUP by killing the shell with extreme prejudice (kill -KILL $$
from that shell, which bypasses any exit trigger that the indicated process has).