Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a Ubuntu web server for Rails 3.0 application. when I login to my webserver and do

top

I get set of processes with their stats. Out of that nano process is occupying 100% of the CPU. And that nano process is a root process. I dont know what is going wrong. Because of this, my apache processes, ruby processes all are getting their chance to answer to answer any web requests.

I am the only one who is logged in via ssh. I have disabled webserver logins via password. Please help.

share|improve this question
    
Use vi instead? ;) –  EEAA Dec 18 '10 at 15:54

2 Answers 2

up vote 2 down vote accepted

I've had this happen with other text editting programs if I'm ssh'd into the box and lose connection. When I go back in, the process I was using before disconnect was taking 100% cpu.

I'd kill it.

share|improve this answer
    
prolly going crazy when loosing the terminal since it's parent died. had the same issue with vi but didn't thought of tracing it to see where the cpu goes. –  sysfault Dec 18 '10 at 16:34

If you have sudo permissions, you can kill that process. Note you may lose something important that is being edited in nano, so be careful, especially to get the right pid.

First find the pid:

ps -ef|grep nano

This will list all nano processes, something like this:

root 1234 0 0 08:13 ? 00:00:01 nano

find the pid in the second column (1234 in the above example). Then you can do:

sudo kill <pid>

If that doesn't work:

sudo kill -9 <pid>

Replace the <pid> with the actual pid.

If you don't have sudo permissions, then you can try using su and log in as root in a similar way, though in that case you need the root password (sudo asks you for your password, i.e. the password of the currently logged in user). If you don't have any way to log in as root, then you cannot do anything about that process - you need to contact somebody who has such permissions.

share|improve this answer

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.