Skip to content

Instantly share code, notes, and snippets.

@philipcristiano
Last active December 18, 2015 22:28
Show Gist options
  • Save philipcristiano/5854406 to your computer and use it in GitHub Desktop.
Save philipcristiano/5854406 to your computer and use it in GitHub Desktop.
Restart gunicorn worker
echo 'Killing children of ' $1;
children=$(pgrep -P $1)
for child in $children
do
echo 'Killing' $child
kill $child
response=$(timeout 60 nc -w 0 -ul 4012)
if [ "$response" != '200 OK' ]; then
echo 'BROKEN'
exit 1;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment