I would like to ask, I connect to the server in the local virtual machine, the person is not next to the computer, always disconnect the server, how to solve

clipboard.png
python * * py & is this how I run, or is it disconnected?


the same old question. If your process needs to run stably in the background for a long time, it is recommended to write it as service. For CentOS 7, Ubuntu 16.04 and other operating systems, systemd is used to do service manager, to write systemd scripts. For operating systems such as CentOS 6 and Ubuntu 14.04, using upstart-managed services, you can write upstart service scripts. The relevant data can be accessed by yourself, and it is not difficult to write.

if you only need to run in the background temporarily, you can consider running it in screen or tmux virtual terminal, which can help you hold session, to prevent accidental disconnection.


configure ServerAliveInterval: on the local virtual machine

Both of the two ways mentioned by
  @ Feng_Yu  are feasible. 

in addition, you can also use pm2 supervisor and other process management tools

Menu