Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
  • Context: Ran a backup thinking it'd take no more than 1-hour... and it's still going. The process is a MySQL DB backup that has the DB tables locked.
  • OS: CentOS-5.x
  • Goal: Find and kill remotely a process running on CentOS-5.x

Possible Requested Help:

(1) How do I find it, meaning how do I view all process and sort by CPU use; since I have no idea what the process is, but I'm guessing it's taking up most the CPU cycles now and has a name I'll figure out.

(2) How do I kill it. Please use the following notation, where # is the CMD-line itself: # cd / -- meaning change directory to root. If the command allows sudo to be used, include it if if it's unlikely to be needed, example: # sudo cd /secure -- meaning change directory to /secure based on sudo rights.

NOTE: Really not sure if the above is clear, so if you have any questions, please comment and I'll reply. Thanks!

share|improve this question
add comment

3 Answers 3

up vote 3 down vote accepted

top will show you the processes on the system, sorted in default by CPU usage. Press k to select a process to kill. Press q when you want to exit top.

share|improve this answer
    
@Ignacio Vazquez-Abrams: +1 Thanks, I'll try it right now. –  blunders Nov 5 '10 at 11:08
    
@Ignacio Vazquez-Abrams: Entered the PID, hit ENTER, and got this: "Kill PID 2 with signal [15]:" -- did a quick google search and it appears I enter the number "9" -- is that correct, and if so, what does that mean? For now, I exited top, and then ran it again to confirm the PID is still running; which it is. –  blunders Nov 5 '10 at 11:15
1  
9 is SIGKILL, which is a bit harsh since it doesn't let the program do any cleanup. Give it 15 (SIGTERM) then wait a bit. If it still refuses to die, then you can try SIGKILL. –  Ignacio Vazquez-Abrams Nov 5 '10 at 11:25
1  
If you want to kill arbitrary processes then you will need to run top as root, whether you use sudo or log in as root directly. –  Ignacio Vazquez-Abrams Nov 5 '10 at 11:26
1  
Having locked the tables is bad; you'll probably have to restart MySQL after killing it. Also, top itself doesn't require root permissions, only killing the process may (but since there's no way to separate that from top...). –  Ignacio Vazquez-Abrams Nov 5 '10 at 11:44
show 4 more comments

Its unlikely to be delayed due to CPU usage - it should be spending most of its time sleeping while I/Os going on. And you should not kill the client process - kill the client connection on the DBMS - see

mysqladmin processlist

and

mysqladmin kill

share|improve this answer
add comment

Or You may try htop :)

yum install htop
share|improve this answer
    
how would I use htop to solve this problem? –  blunders Nov 5 '10 at 11:38
    
You can run htop command, then press F6 to sort by CPU, memory, etc usage, then select proccess from the list, then press F9 and select signal which will be send to the process, for example to send sigkill (9) press 9 and then hit enter :) –  Ryszard Stawiarski Nov 5 '10 at 12:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.