I'm trying to start a test server via ssh but it always dies once i disconnect from ssh.
Is there a way to start a process (run the server) so it doesn't die upon the end of my ssh session?
Keep Linux Processes Running After Exiting Terminal We will use disown command, it is used after the a process has been launched and put in the background, it's work is to remove a shell job from the shell's active list jobs, therefore you will not use fg , bg commands on that particular job anymore.
When you want a process to continue running even after you log off a Linux system, you have a couple options. One of them is to use the disown command. It tells your shell to refrain from sending a HUP (hangup) signal to the process when you log off. So, the process continues running.
As an alternative to nohup
, you could run your remote application inside a terminal multiplexor, such as GNU screen
or tmux
.
Using these tools makes it easy to reconnect to a session from another host, which means that you can kick a long build or download off before you leave work and check on its status when you get home. For instance. I find this particularly useful when doing development work on servers that are very remote (in a different country) with unreliable connectivity between me and them, if the connection drops, I can simply reconnect and carry on without losing any state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With