LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to kill process if it can't be killed? (https://www.linuxquestions.org/questions/linux-general-1/how-to-kill-process-if-it-cant-be-killed-4175485702/)

Mr. Alex 11-24-2013 04:00 AM

How to kill process if it can't be killed?
 
Hello LQ.org.

I have problems with vlc and kdenlive. Sometimes they hang up and can't be terminated no matter what I do. For example I try to kill vlc with

Code:

killall vlc
which gives me no text output and does nothing to vlc. Or I

Code:

ps aux | grep vlc
and then

Code:

kill
whatever process that is (both as user and as root) and still no luck.
Try htop with "F9" and then different termination signals and none of them work. So the only way to actually terminate those processes for me is to reboot.

Can you suggest any other thing to terminate them without rebooting?

druuna 11-24-2013 04:08 AM

kill <PID> is a nice way to kill a process, if that does not work you could try kill -9 <PID>

If a process becomes a zombie you cannot kill or remove it, only option is to reboot.

Mr. Alex 11-24-2013 04:24 AM

Quote:

Originally Posted by druuna (Post 5069722)
kill <PID> is a nice way to kill a process, if that does not work you could try kill -9 <PID>

If it's a SIGKILL call, then I already tried it through htop. And zombie process shouldn't consume any CPU resources, right? Not in my case — VLC might load CPU 100% and still be hanging as zombie.

druuna 11-24-2013 04:45 AM

Quote:

Originally Posted by Mr. Alex (Post 5069728)
If it's a SIGKILL call, then I already tried it through htop.

Yep, kill -9 and kill -SIGKILL do the same thing. Have you tried it from the command line instead of using htop?

Quote:

And zombie process shouldn't consume any CPU resources, right?
Correct.

Quote:

Not in my case — VLC might load CPU 100% and still be hanging as zombie.
A zombie process is recognisable by the process status (the STAT field in ps or the S field in top). The status will be Z for a zombie process.

You can check for zombied processes like this:
Code:

ps aux | awk '{ print $8 " " $2 }' | grep -w Z

Mr. Alex 11-24-2013 04:48 AM

Quote:

Originally Posted by druuna
Have you tried it from the command line instead of using htop?

Probably not. Next time I have this situation, I'll try. But from here it doesn't seem to have any real difference.

Xeratul 11-24-2013 04:59 AM

pkill -9 chromi* <-- not sure

kill -9 <number#> that you find using ps aux

syg00 11-24-2013 05:02 AM

Possibly running in interrupt context - that's "higher" (FSVO ...) than kernel context.

In which case it's crap code, and you're out of luck trying to kill it.

Just a guess.

jamison20000e 11-24-2013 02:20 PM

Also try:
Code:

sudo {...}
it's worked for me.

Mr. Alex 11-25-2013 07:42 AM

jamison20000e, I used sudo for this purpose. Back then it didn't help. Last time kdenlive froze, "kill -9" helped. Will see how it does with VLC.

rlug 03-20-2014 05:01 AM

Hi,

You can try good solution suggested at :
# What is Zombie Process ?
# How to Kill Zombie Process ?

Habitual 03-21-2014 03:29 PM

How to kill without the kill command


All times are GMT -5. The time now is 08:52 PM.