Should you kill or terminate a misbehaving process.

Have you ever had a linux process that was not running but when you try to start or restart the process nothing happens. You may find that you need to kill the process before you try to restart it because the process is actually still alive and not responding or not actually alive but the pid (which is a unique identifying number that tells the kernel that the process has stated or is alive) was not removed when the process ended. So the kernel thinks that the process is working just fine when in fact it is not and won’t start it a new.

Before you kill the process you should always try to terminate it first. Because terminate tries to end the process gracefully and finish writing any remaining data that the process may have stored in memory as well terminate will finish writing any logging data to assist you to find out what caused the process to fail in the first place

The command to terminate a process is

Code

kill -15 pid

replace pid with the pid number

If your attempt to terminate the process fails then you will have to use the more powerful kill command which will bypass the process and ask the kernel to kill the misbehaving process directly.

The command to have the kernel kill a process is

Code

kill -9 pid

replace pid with the pid number

Before you can kill the process you will have to find its pid. To find out the pid of a running process in virtualmin you can go to

Webmin> System> Running Processes>

Linux, kill, terminate, kill -15 pid, kill -15, kill -9 pid, kill -9, pid, linux process, process, not running, process not running, start, restart, start or restart, not responding, process not responding, kernel, pid not removed, kill the process, stop the process, terminate the process, end the process, end the process gracefully, writing any logging data, virtualmin, webmin, Running Processes,

and select pid from the Display menu then scroll to find the pid of the process you are looking for. Click on the pid of the process you want to kill and you will be taken to a new screen where you can terminate or kill the process by clicking the matching button.

Linux, kill, terminate, kill -15 pid, kill -15, kill -9 pid, kill -9, pid, linux process, process, not running, process not running, start, restart, start or restart, not responding, process not responding, kernel, pid not removed, kill the process, stop the process, terminate the process, end the process, end the process gracefully, writing any logging data, virtualmin, webmin, Running Processes,

If you are not a virtualmin user you can open a terminal window and type

Code

ps aux | less

which will give you a list that looks something like

Linux, kill, terminate, kill -15 pid, kill -15, kill -9 pid, kill -9, pid, linux process, process, not running, process not running, start, restart, start or restart, not responding, process not responding, kernel, pid not removed, kill the process, stop the process, terminate the process, end the process, end the process gracefully, writing any logging data, virtualmin, webmin, Running Processes,

when you have the pid you need to kill the process. As mentioned above you should always try the terminate command first. In the terminal window type

Code

kill -15 pid

replace pid with the pid number

If the process does not terminate you will the need to use the more powerful kill command

Code

kill -9 pid

replace pid with the pid number