I have a Java process that I run. If I start the process via SSH and pass commands to it works fine, but if I then terminate the SSH session I lose "control" of the process. How can I regain "control" of that process? It's still running.
I know the process ID. Is this possible or must I restart the process?
You probably want to start a screen.
Try typing screen at the prompt. (Install the program if you don't have it.)
Example run:
$ ssh yourserver
Password:
$ screen # start the screen
$ java -jar YourApp.jar
output...
more output...
<Ctrl-A D> # detach process for later reattach
$ exit # exit your ssh session
next day
$ ssh yourserver
Password:
$ screen -x # reattach process
$ java -jar YourApp.jar
output...
more output... # back to where we were yesterday.
Type man screen for more information.
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