LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   kill a process (https://www.linuxquestions.org/questions/linux-software-2/kill-a-process-312829/)

bratch 04-13-2005 11:18 AM

kill a process
 
I'm trying to kill the process called java, as shown here in gnome-system-monitor:

http://www.bratch.co.uk/coven/process.png

I've tried ending it with gnome-system-monitor, I'll tried doing "killall java", I've tried "pkill -kill java", I've tried "pkill java", and I've tried "kill <pid>".

Nothing will kill it, it just sits there using 49% of 1 CPU (the CPU has hyper-threading).

How can I kill it without rebooting?

(It was the java process that Azureus was using, and was left there for some reason when Azureus closed.)

Thoreau 04-13-2005 11:20 AM

killall -9 java

bratch 04-13-2005 11:21 AM

Nope, still there.

Technoslave 04-13-2005 11:22 AM

On a command line as root:

kill -9 `ps auxw | grep -i java | awk '{print $2}'`

If that doesn't kill everything java related then you'll need to reboot.

B/c I'm not totally familiar with gentoo, if your ps doesn't support auxw as an option, then:

kill -9 `ps -elf | grep -i java | awk '{print $4}'`

Also, before you reboot, post the results from this:

ps auxw | grep -i java ( or the ps -elf )

bratch 04-13-2005 11:28 AM

Code:

bash-2.05b$ su
Password:
bash-2.05b# kill -9 `ps auxw | grep -i java | awk '{print $2}'`
bash: kill: (16859) - No such process
bash-2.05b# kill -9 `ps -elf | grep -i java | awk '{print $4}'`
bash: kill: (16870) - No such process
bash-2.05b# ps auxw | grep -i java
bratch  12153 98.2  0.0      0    0 ?        Zl  06:57 619:49 [java] <defunct>
root    16887  0.0  0.0  2616  716 pts/0    S+  17:28  0:00 grep -i java
bash-2.05b#

Wasn't a sucess, and that's what happened.

Technoslave 04-13-2005 12:04 PM

Ah, defunct.

You can try this:

pstree 12153 to find the parent of the java and kill the parent, that may or may not work. If it doesn't work then you'll have to reboot.

If there's no parent or child left of the process then you're SOL and rebooting is the only way to fix it.

bratch 04-13-2005 12:10 PM

Code:

bash-2.05b$ pstree 12153
java

I assume there is no parent left over then.

It's disappointing when Linux does things like this that I have to reboot for :(

Technoslave 04-13-2005 02:05 PM

Yeah, looks like it's hosed.

I know what you mean about zombie processes, you could do some lookups and the like on either defunct or zombie processes to find out why they happen, etc.

Other than that, reboot to get rid of it - sorry.

twsnnva 04-13-2005 05:29 PM

Perhaps "killall java -SIGKILL" will kill it?

Brian1 04-13-2005 06:00 PM

Which version of java is it. Some releases have issues working on smp setups. There are a few patches and ideas floating around the net. I do not remember what it requires though. Look through google for smp and java.

One item I saw was add ' noexec=off to your grub.conf file for booting kernel.
Run a non smp kernel.
Looks like IBM java is working with redhat to fix the issue. Both IBM and Sun Java have the same issue.

I have a Quad Zeon system that once in while did the same. Have upgraded to the latest Java with SDK and haven't noticed it yet. But seldom mess with or visit java sites.

Brian1
" Google the Linux way @ http://www.google.com/linux "


All times are GMT -5. The time now is 03:15 PM.