Skip to content

Instantly share code, notes, and snippets.

@chiragchamoli
Forked from codeAshu/startup_script.sh
Created September 9, 2018 14:45
Show Gist options
  • Save chiragchamoli/07a79d7e7389c45ec4679af942fb741c to your computer and use it in GitHub Desktop.
Save chiragchamoli/07a79d7e7389c45ec4679af942fb741c to your computer and use it in GitHub Desktop.
#!/bin/bash
kill -9 $(ps aux | grep 'uwsgi' | awk '{print $2}')
source /home/ubuntu/.env/myappenv/bin/activate
cd /home/ubuntu/myapp
kill -9 $(ps -aux | grep 'worker.py' | awk '{print $2}')
nohup redis-server &
nohup python -u worker.py > worker.out &
uwsgi --socket :8881 --plugin python --wsgi-file main.py --callable app --buffer-size 32768 --process 4 --logto /home/ubuntu/myapp/log/myapp.log &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment