I have a working server using Tornado now, according to the answer here: Python BaseHTTPServer and Tornado
I'd like to daemonize it. I have been reading over and over this daemon class example here, but I can't figure out how it wraps around my server code. Do I just put all the code from __main__
in the run()
that I override?
How do I subclass it also if it's in another file? Make sure it's in the same directory and using it's filename without .py extension to import?
I'm just looking for the simplest way to run my python web server script with nothing more than a simple call such as ./startserver.sh
(for example, if I was to use a bash script) and have it run in the background with no nohup.out file and all stdout and stderr redirected to log files.