Kill, killall

From Wiki

Jump to: navigation, search

To terminate/end a Process

The proper way to end a task/service is via:

/etc/init.d/service stop|restart

If the service, or process isn't behaving, you can kill it with:

kill PID
#kills the PID
#To find out the PID use "ps -eaf" or "top"

If the service is really not behaving, you can send a level 9 kill signal:

kill -9 PID

If the computer is really really hanging, and bogged down, so much so that you cant do a "top" or a "ps -eaf", you can kill it by name and all of the child processes using:

killall -9 apache2

The above, killall worked for me on an extremely slow existing ssh connection. New ssh connections would not even open! On trying to open a new ssh connection the following error was recieved:

ssh_exchange_identification: Connection closed by remote host

Trying to log on locally resulted in "Login timed out"!!!!! As I was already logged on as root via ssh, I was just able to initiate the above killall for apache which ate up all resources.

Personal tools