Keep Server running even after closing the SSH login window in digital ocean.
Keep Server running even after closing the SSH login window in digital ocean.
Run server on one window and open a new window to run screen simultaneously.
Ref: link - https://www.digitalocean.com/community/questions/how-keep-my-app-running-after-close-putty-f82aab17-ca84-46a0-8a39-3e25f1dd2d45
Run server on one window and open a new window to run screen simultaneously.
sudo apt-get install screen
Once it is installed type 'screen' to start screen.screen
Hit enter, and you’ll be at a normal prompt.
To disconnect (but leave the session running)
Hit Ctrl + A and then Ctrl + D in immediate succession. You will see the message [detached]
Now you can close the server window and check the ip, to see if its still running.
Some extra commands
To reconnect to an already running session
screen -r
To reconnect to an existing session, or create a new one if none exists
screen -D -r
To create a new window inside of a running screen session
Hit Ctrl + A and then C in immediate succession. You will see a new prompt.
To switch from one screen window to another
Hit Ctrl + A and then Ctrl + A in immediate succession.
To list open screen windows
Hit Ctrl + A and then W in immediate succession
To list open screen recorded listing
screen -list
Output: There are screens on:
9467.pts-1.ubuntu-s-1vcpu-1gb-blr1-01 (09/05/2018 01:22:32 PM) (Detached)
9210.pts-0.ubuntu-s-1vcpu-1gb-blr1-01 (09/05/2018 01:15:33 PM) (Detached)
2 Sockets in /var/run/screen/S-root.
To remove sessions
working command: screen -S 23536 -X quit
Point to remember:
For recording a session and record a running Orthanc, stop Orthanc first(if there is any running instance of server).
Now type screen first.
press enter
now you will be landing on the normal looking screen.
run Orthanc here.
once done press ctrl +a and then ctrl+d. this will detach the session.
Now it is session is up and saved.
close this terminal window and test.
For recording a session and record a running Orthanc, stop Orthanc first(if there is any running instance of server).
Now type screen first.
press enter
now you will be landing on the normal looking screen.
run Orthanc here.
once done press ctrl +a and then ctrl+d. this will detach the session.
Now it is session is up and saved.
close this terminal window and test.
Othanc ./Configuration.json
ReplyDeleteOthanc ./Configuration.json --verbose