1

Possible Duplicate:
How do I keep jobs running after logout?

I'm on a Mac and I SSH into my Ubuntu box and run node.js (or any other application), but when I close out of the terminal on my Mac, it quits the process on the Ubuntu box. How can I let the process continue running independent of the terminal on my Mac?

0

2 Answers 2

1

Couple of things you can do. "CTRL + z" will stop the running process, then you can type "bg" to background it to keep it running. OR You can just start the command with "&" at the end of the line. This will start it as a background process. Then you can exit the shell.

1

One solution would be to use GNU Screen. It's a 'multiplexer' which in this case means it will allow you to have multiple virtual terminals open with one connection. The cool thing about is it that when you 'detach' (or close) from screen, it will not only continue whatever processes were running; it will keep that terminal open in the same exact state that you left it in.

So step-by-step of how you'd do this:

  1. enter 'screen' on your terminal.
  2. press enter to get past the license screen
  3. do whatever you need to do on that terminal. (the shortcuts for screen are here: http://www.pixelbeat.org/lkdb/screen.html)
  4. when you're done, you want to 'detach' (ctrl-a d)
  5. when you want to come back, do 'screen -R' to go to your last screen session. everything should be there as you left it, with stuff running and whatnot.

Not the answer you're looking for? Browse other questions tagged .