SSH session closing whilst virtualenv session stays open (I think)

Posted by ing0 on Server Fault See other posts from Server Fault or by ing0
Published on 2012-07-01T00:05:16Z Indexed on 2012/07/01 3:17 UTC
Read the original article Hit count: 559

Filed under:
|
|
|
|

I've been developing some sites using Flask recently (running on debian within a virtualenv), and when I am testing I can run it on a port, let's say post 5000.

So I run the script like so:

. env/bin/activate           <- go into virtual environment
python file.py               <- run python script

And I will be given this message:

Running on http://0.0.0.0:5000/

So this all works great and I can access my site on this port fine. However... my rubbish ISP always does this thing where it resets something around 1am every morning. I have no idea what this is, everything runs like normal but I always get disconnected from any SSH sessions open. This leaves it running and all I can do is call:

lsof -i

Which will show me the process but if I kill it and then rerun it things get weird. The:

Running on http://0.0.0.0:5000

message still shows but I cannot connect to it anymore. I've tried changing the port number and it seems the only thing that works is trying again later on or on another day. Now I'm assuming that something on my server resets inbetween these times and I would like to think it was maybe that virtualenv session timing out, but I cannot find out how to do this manually, does anyone know?

© Server Fault or respective owner

Related posts about debian

Related posts about webserver