Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing rogue user processes

Status
Not open for further replies.

capitano

Programmer
Jul 30, 2001
88
US
I'm running a cluster of RH7.1 servers and am doing a significant amount of network socket testing--running network load generators against SMTP, POP, HTTPD, WHOIS servers--until they scream for mercy.

Not surprisingly, these 100's and 100's of processes don't always get cleaned up properly, especially if the software doesn't clean up after it's fork() children.

My question is: Is there a tidy command-line thing I can do to kill off these processes without having to either reboot, or do it 1-by-painstaking-1? All processes are assoc.'d with a particular uid. So, I'm guessing there's a nice sequence of piped commands of the form:

ps -all processes | grep to a uid | kill

or maybe there's a script out there?

Thank you!

Bryan C.
 
try this :
kill `ps -aux | grep YOUR_USER | grep -v -e grep | awk '{print$2}'`

where YOUR_USER is the user to diconnect (because the first PID is his login PID and killing it will kill all his tasks)

Hope that will help ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top