You learn something new every day!
Today I learned about the disown builtin in bash and zsh. When you disown a job, it will no longer receive a HUP signal when you exit your shell.
[email protected]:~ % while true; do date >> date.log; sleep 10; done&
So now you've got the current date being appended to date.log every 10 seconds.
Try exiting your shell:
[email protected]:~ [1016%1]% exit zsh: you have running jobs.
But use the disown command:
[email protected]:~ [1017%1]% disown %1 [email protected]:~ % exit
and your shell exits without complaining. Meanwhile, your job keeps running in the background!