tags:

views:

55

answers:

2

Hi, this really silly question probably, as no one else seems to be having this problem. In the Jetty documentation it says jar -jar start.jar starts Jetty, and it does. But when I close my SSH console, obviously it dies.

How do I run it PROPERLY?

+2  A: 

One way is to use nohup

nohup jar -jar start.jar

This has the advantage of writing stdout and stderr to a file

Another way would be to use screen

gnibbler
With nohup/screen how do I stop it?
Matt H
@Matt, with nohup, you can kill the process with `kill`. with screen you reconnect to the screen session and stop it the usual way (ctrl-c or similar)
gnibbler
+2  A: 
java -jar start.jar & 

(to run in the background) should also work, though logging won't be transmuted as nice as w/nohup.

This is because killing the shell that started a process (e.g. by logging out) will kill process to unless they're background processes. Screen works since as well since it runs in the background, and screen effectively keeps your session running while you attach/detach.

jayshao