Created
February 16, 2019 01:29
-
-
Save yjzhang/030fbb2f7a594cfe8e9f34af3ae00eab to your computer and use it in GitHub Desktop.
kills all gunicorn processes with a certain port number. useful for when there are multiple gunicorns running on different ports.
This file contains 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/bash | |
# kills all gunicorn processes with 8889 | |
pids=`ps ax | grep gunicorn | grep "8889" | awk '{split($0,a," "); print a[1]}'` | |
# TODO | |
for pid in $pids; do | |
killall -9 $pid | |
echo "killed gunicorn process $pid" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment