To avoid this you can make your processes not receive SIGHUP. Thus when your ssh session gets disconnected all your processes will terminate. The common action upon receiving SIGHUP is to terminate. The HUP signal (or SIGHUP) is sent by the terminal to all its child processes when the terminal is closed. Here is a good tutorial with diagrams explaining the concept: Two popular terminal multiplexers are screen and tmux. When you reconnect to the server you can reconnect to the virtual terminal and everything will be as if nothing happened, other than the time which passed. The virtual terminal will keep running even if your real terminal is closed with your ssh session.Īll processes started from the virtual terminal will keep running with that virtual terminal. Alternatively you can make the process not receive the HUP signal.Ī terminal multiplexer provides "virtual" terminals which run independent from the "real" terminal (actually all terminals today are "virtual" but that is another topic for another day). The best method is to start the process in a terminal multiplexer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |