I've got a few Python based servers that I need to run, and would like them to start automatically when I start my Ubuntu Server box. What is the best way to execute them like this?
I was hoping I could write a Bash script and use Screen to get them running in the background, where I can check on them every now and then, but where as
echo screen -d -m python
works just fine,
echo screen -d -m `sudo python /home/matt/tornadoServer/tornadoDeploy.py`
doesn't, with no error messages. Is that something to do with the spaces? Even though I did surround it with backquotes? I also tried:
WEB="screen -d -m `sudo python /home/matt/tornadoServer/tornadoDeploy.py`" echo $WEB
As a way of escaping the spaces, but no luck. What's Bash scripting way to do this?
And, once the Bash script works, where can I put it to make it execute on startup?