How to keep Python pgm running if putty disconnects ???

I’m using a BBB Debian (2014-03-27) and I monitor temps with a Python prrogram.
Currently, while developing, I access the BBB from a local PC via Putty.
Various things happen which disconnect my PC session - this morning a dialog box said “A software error cause the connection to unexpectedly close” (or something similar) and temps were not logged for about 4 hours. In the future, I plan to post some “keep alive” timestamp and check that from another machine which will alert me if the monitor box stops posting… but thats another issue.

My question is: How can I have a session that runs on the BBB — that I can connect to if I want to see it’s progress - AND will always be running regardless of a remote session?
I’m sure I could launch the Python pgm at bootup, or crontab, but I don’t know how I could see output from that session.

It might be that I don’t really need to see the output continually - as I’ve become accustomed to via the Putty window. Thats just a comfort issue.
If I wanted to see recent temps, I’m sure I could write another Python pgm to analyze the log file and show me recent data.

Your ideas appreciated.

You could run your program in a screen (
or byobu ( session, which will stay alive after your putty
got disconnected. Both could be easily apt-get installed on BBB debian. I
prefer byobu myself.

And if you start your python program @reboot from crontab, you could pipe
the output to a file (program >> outputfilename). You could use "tail -f
outputfilename" to monitor the output when you connect with putty.


nohup command-with-options &

$ apt-cache search terminal multiplexer
screen - terminal multiplexer with VT100/ANSI terminal emulation
tmux - terminal multiplexer

You can use one of those, OR you could also run your process as a service. Google “howto Debian service” for more information.