Os processos do Ubuntu lidam com sinais da mesma forma que outras distribuições Linux e Unices fazem. Quando uma sessão SSH é desconectada, um sinal SIGHUP é enviado para o líder da sessão process , que provavelmente seria bash .
Bash, por sua vez, limpa depois de si :
The shell exits by default upon receipt of a
SIGHUP. Before exiting, an interactive shell resends theSIGHUPto all jobs, running or stopped. Stopped jobs are sentSIGCONTto ensure that they receive theSIGHUP. To prevent the shell from sending theSIGHUPsignal to a particular job, it should be removed from the jobs table with the disown builtin (see Job Control Builtins) or marked to not receiveSIGHUPusingdisown -h.If the
huponexitshell option has been set withshopt(see The Shopt Builtin), Bash sends aSIGHUPto all jobs when an interactive login shell exits.
disown é um comando interno do Bash. nohup é um comando externo com efeito semelhante.
Eu não recomendo a reconfiguração do Bash para não matar todos os seus processos filhos (nem sei como fazer isso). Em vez disso, um objetivo melhor seria evitar que Bash morresse quando seu TTY desaparecesse. Você pode usar screen , tmux ou mosh para manter o Bash ativo.