kill pid is not working?
To remove a D State
Process, since it is uninterruptible, only a machine reboot can solve the problem in case its not automatically handled by the system.
Usually there is a very few chance that a process stays in D State
for long. And if it does then there is something not properly being handled in the system. This can be a potential bug as well.
Below is an extract from OpenVZ about what is D State
of a process.
D state occurs then the process is in uninterruptible sleep. This state is bad, because you can't do anything with the process in D state. Fortunately, process normally remains in such state not for so long. But if you have a heap of D state processes then some logic in system is disrupt. If that is happening, the very important thing is to determine where this unlucky sleep occurs. It is easy to do with ps command with l option. WCHAN column shows the name of the kernel function where the process is sleeping:
# ps axl | awk '$10 ~ /D/'
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
vass 13478 7.2 0.0 1732 624 pts/1 D+ 17:36 0:00 find ./
[Refernce] - https://openvz.org/Processes_in_D_state
Related videos on Youtube
arsenal
profile for ferhan on Stack Exchange, a network of free, community-driven Q&A sites http://stackexchange.com/users/flair/335839.png
Updated on September 18, 2022Comments
-
arsenal over 1 year
This is pretty weird now. I am trying to kill a process by using its
pid
but it is not working at all.root@machineA:/home/david# ps aux | grep modelling david 5075 0.0 0.0 1285420 29404 ? Dl 21:05 0:01 /opt/modelling/bin/http root 8730 0.0 0.0 8096 936 pts/4 S+ 22:43 0:00 grep --color=auto modelling
Below is the way I am kiiling the process.
root@machineA:/home/david# kill -9 5075
And then if I do the
ps
again. I can see the same result back again.root@machineA:/home/david# ps aux | grep modelling david 5075 0.0 0.0 1285420 29404 ? Dl 21:05 0:01 /opt/modelling/bin/http root 9062 0.0 0.0 8100 936 pts/4 S+ 22:44 0:00 grep --color=auto modelling
Does anyone know what is happening? This was working fine earlier and it has started happening few hours back and I am not sure what's wrong?
Update:-
I did top and it is showing as
D
instead ofZ
which isuninterruptible sleep
5075 david 20 0 1255m 28m 13m D 0 0.0 0:01.09 http
-
mikeserv almost 10 yearsHere is a copy-pasted link to a copy-pasted answer I did yesterday about this very thing: unix.stackexchange.com/a/134899/52934
-