I use the following simple code snippet to kill specific processes based on owner:
kill -9 `ps auwx | grep service_name | awk 'match($1,"owner_name") {print $2}'` 2&>1 > /dev/null
owner_name is the owner of the process.
So, if they are pop connections change service_name above to pop.
Always look at the process stack generated by ps auwx first to get an idea of who owns what processes. The above snippet is best used in a script where one can pass in the owner_name and service_name parameters as arguments.
Various nuggets of useful technical information.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment