Last active
December 9, 2015 23:48
-
-
Save srstanic/4346448 to your computer and use it in GitHub Desktop.
Kill zombie processes Foreman started
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 | |
kill -9 `lsof -P -i :5000 | sed -n 's/python *\([0-9]*\).*\:5000.*/\1/p'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think
pkill
will also do? I'm not sure if the -n option to pkill (newest matching) would always result to the same process returned bylsof
, though.seems to have the same result for me.