I have a web-server that is based on flask+tornado combination. It works inside of a virtual environment (set up with python virtualenv).
I want the server to launch automatically on start up, from a regular user. What i have done to achieve this:
1) i have written a startup script with following contents:
cd /home/ubuntu/myserver # enter virtualenv source venv/bin/activate # launch python app.py > serverlog.log 2&>1 &
2) i have set up a crontab with
crontab -e as:
SHELL=/bin/bash @reboot /home/ubuntu/start_service.sh
When i execute startup script from the command line, everything is correctly launched. But after reboot in
serverlog.log i see a stacktrace that tells of failure to bind to port 5000. what can i do to fix it?