Created
August 12, 2021 03:33
-
-
Save seahrh/2cb3bf9bc0d5a864a005064ad1ce1bbe to your computer and use it in GitHub Desktop.
kill processes
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
# kill all processes that match this command | |
pkill -u user -f "gunicorn myapp.app.main:app" | |
# kill sentence-transformers processes SIGKILL | |
pkill -9 -u user -f "myapp/venv/bin/python3 -c from multiprocessing" | |
# manual kill parent and child processes | |
# see uvicorn multiprocessing bug https://github.com/encode/uvicorn/issues/852 | |
PARENT_PID=$(pgrep -u user -f "uvicorn myapp.app.main:app --port=1234") | |
# kill child processes | |
kill $(pgrep -P $PARENT_PID) | |
# kill parent process | |
kill "$PARENT_PID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment