1

Possible Duplicate:
Keeping a linux process running after I logout

I made a Code jar and I want to run the Code on a server linux, I want to close the session between me and the server, is there a way to keep the Code running after closing the session with the server?

2

2 Answers 2

2

You could try

nohup java -jar YourCode.jar &

(the ampersand sends the process in the background, nohup makes your process not exit together with the shell.)

0

For a quick test nohup is okay. But if you want to be safe you should use tools like start-stop-daemon (on a debian/ubuntu box) for example.

With it it is easy to write your own initscript. You can safley terminate your application on system shutdown. Like closing Database connections, Closing Transactions and so on. You can start your Process on system start. You can chroot your Process (if wanted) You can switch to a special process user, so it won't run under root. and so on.

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