RE: Operating systems Wars!
March 12, 2017 at 10:53 pm
(This post was last modified: March 12, 2017 at 10:55 pm by Autumnlicious.)
Unless of course the program has a different item for its command field or is being run by a common interpreter.
When you administrate large clusters, you learn that the lowest common denominator works every time. Much better to type a few more characters in your Fabric scripts.
For any item in the process stat (replace the $ITEM placeholder with what your looking for)
Works on old and new Linux and BSD based OS that I've encountered. I've encountered quite a few installs without pkill (not that pkill helps for Python scripts unless you use '-f' for glob matching). Should work on ancient Unix installs given that awk, ps and xargs are very old programs.
When you administrate large clusters, you learn that the lowest common denominator works every time. Much better to type a few more characters in your Fabric scripts.
For any item in the process stat (replace the $ITEM placeholder with what your looking for)
Code:
ps ax | grep $ITEM | grep -v grep | awk '{print $1}' | xargs kill -9
Works on old and new Linux and BSD based OS that I've encountered. I've encountered quite a few installs without pkill (not that pkill helps for Python scripts unless you use '-f' for glob matching). Should work on ancient Unix installs given that awk, ps and xargs are very old programs.
Slave to the Patriarchy no more