Question

I am currently implementing a web server on a raspberry py using the web.py framework. For convenience, I am using ssh, so I can perform tests on the raspberry directly from my laptop.

My problem is that I can't close the ssh session without the web server stopping to work, because when the session closes, a logout is performed automatically.

Does anyone know a possibility to avoid the logout while closing the ssh session? I am using Linux on both my laptop and the raspberry. Thank you.

Was it helpful?

Solution

The best way to do this is by using screen. It lets you "multiplex" your command line, meaning you can run multiple commands at the same time. Also, when you exit your ssh session, the commands running in screen will continue to run, and it is very easy to install as well.
Here's a guide for installing and running it, and if you have any other questions, comment or google for more screen guides

OTHER TIPS

I have raspLite on the raspberry pi 3 model b and this is how i used screen in the bash enviroment.

  1. ssh pi@hostname
  2. apt-get install screen
  3. screen
  4. Then I press Enter to proceed through the License Agreement.
  5. npm start

Then I close the terminal and the webserver continues untill i use the SIGINT kill command on the pid.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top