I am trying to create a upstart script for my flask application. I am using uWSGI to run it. My application resides in /home/user/apps/myapp. It contains virtual environment in venv. My goal is to activate the virtual environment and exect ini script there
#description "Starts my app"
#author "Me <myself@gmail.com>"
start on runlevel [2345]
stop on runlevel [!2345]
script
cd /home/user/apps/myapp
source venv/bin/activate
exec uwsgi --ini myapp.ini
end script
When i run the command sudo start myapp in /etc/init/. I got errors like process terminated with status 127. This means that my command is unkownn. I am new to upstart scripts. What am i doing wrong, these scripts work fine in shell.