Created
September 12, 2012 05:12
-
-
Save shiloa/3704416 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ****** | |
# This goes in /etc/init.d | |
# ****** | |
# start nginx | |
/usr/local/bin/nginx/ | |
sleep 10 | |
# start the app | |
/srv/my_application/script/start | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
APP_ROOT=/srv/my_application | |
echo "stopping the app..." | |
bash $APP_ROOT/scripts/stop | |
sleep 5 | |
echo "starting the app..." | |
bash $APP_ROOT/scripts/start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
APP_ROOT=/srv/my_application | |
cd $APP_ROOT | |
# start a couple of instances | |
# note that the worker timeout is set to 300s due to an app requirement | |
gunicorn -w 4 -b 127.0.0.1:8000 -t 300 -D --access-logfile=$APP_ROOT/log/access.8000.log --error-logfile=$APP_ROOT/log/error.8000.log my_app:app | |
gunicorn -w 4 -b 127.0.0.1:8001 -t 300 -D --access-logfile=$APP_ROOT/log/access.8001.log --error-logfile=$APP_ROOT/log/error.8001.log my_app:app | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# nothing fancy here | |
pkill gunicorn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment