Skip to content

Instantly share code, notes, and snippets.

@phouse512
Forked from sontek/gist:1362947
Last active August 29, 2015 14:09
Show Gist options
  • Save phouse512/a0fc152e09422ee882f3 to your computer and use it in GitHub Desktop.
Save phouse512/a0fc152e09422ee882f3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# run if user hits control-c
control_c()
{
echo "Oh no, exiting!"
for pid in $(cat gunicorn.pid)
do
echo "killing $pid"
kill -SIGKILL $pid
done
rm gunicorn.pid
exit $?
}
# trap keyboard interrupt (control-c)
trap control_c SIGINT
gunicorn -c reloader.py --workers=2 --worker-class=gevent --pid=gunicorn.pid devwsgi:app &
while true; do
:
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment