0

I got an account from my professor for our universities CUDA server for running some tests.

I am connecting via ssh over terminal. The thing is, as I close the terminal the server also seems to kill the running script. As I reconnect it has stopped.

No it is not possible that the script already terminated since those test runs should take a few hours even on those machine..

Can anybody help me here?

OS: Linux cuda01 3.13-1-amd64 #1 SMP Debian 3.13.7-1 (2014-03-25) x86_64 GNU/Linux
Stefan Falk
  • 395
  • 2
  • 3
  • 18
  • Look at [GNU Screen](https://www.gnu.org/software/screen/), [tmux](http://tmux.sourceforge.net/), [dtach](http://dtach.sourceforge.net/), or similar programs. – Daniel Andersson Aug 19 '14 at 15:52
  • possible duplicate of [How can I start a process over SSH such that it will continue to run after I disconnect?](http://superuser.com/questions/524586/how-can-i-start-a-process-over-ssh-such-that-it-will-continue-to-run-after-i-dis), [Prevent process interruption when SSH connection fails](http://superuser.com/questions/601307/prevent-process-interruption-when-ssh-connection-fails), [How do I detach a process from Terminal, entirely?](http://superuser.com/questions/178587/how-do-i-detach-a-process-from-terminal-entirely) – Bob Aug 19 '14 at 15:53

1 Answers1

1

This is normal behavior. When you close the terminal, the SSH session terminates, killing all child processes. You need to use something like tmux or screen on the server to fork and create a persistent shell, which will continue to run after the ssh session terminates, and can be reconnected to when you log in again.

Darth Android
  • 37,872
  • 5
  • 94
  • 112
  • Exactly, simplest solution for you I think is `screen`. It's kind of a virtual terminal. Start it after logging in simply typing `screen`. Then "inside" of screen, start your script, and then you can detach from screen (`Ctrl+A,D`) and you are safe to log out. Next time when you login, type `screen -r`, it will reattach you to screen running in background. – rsm Aug 19 '14 at 16:28