Operating System - HP-UX
1832914 Members
2752 Online
110048 Solutions
New Discussion

Re: How can i kill a process!

 
jack_8
Contributor

How can i kill a process!

I have a program. I debuged it with gdb. when i quit from gdb, I found the program is still running. I try to kill it with command kill -9 ... . But it is no effect. The program still there. My program didn't catch any signals. I don't know how to kill the program without reboot my machine.
best regards.
7 REPLIES 7
Andy Monks
Honored Contributor

Re: How can i kill a process!

if a process won't respond to kill -9, then it's waiting on an unkillable system call, and there is no way to wake it up (without rebooting).
Karthik_2
Regular Advisor

Re: How can i kill a process!

yes I don't think it can be killed or cleared from the process table without a reboot.
If the parent process of this process does not allow this process to die or if the parent process itself is dead .This process will be left in a stale state indefinitely
Its ALL in the MATRIX
Jdamian
Respected Contributor

Re: How can i kill a process!

Hi

You can read the following discussion in the manual pages of "kill" command:

WARNINGS
If a process hangs during some operation (such as I/O) so that it is
never scheduled, it cannot die until it is allowed to run. Thus, such
a process may never go away after the kill. Similarly, defunct
processes (see ps(1)) may have already finished executing, but remain
on the system until their parent reaps them (see wait(2)). Using kill
to send signals to them has no effect.

Good luck !
Mark Vollmers
Esteemed Contributor

Re: How can i kill a process!

Hi-

Check to see if the process is just sitting there or if it is using system resources. If it is not using any resources, it shouldn't hurt anything to leave it there until whenever you reboot next (maintenence, etc). I don't think it will interfere with the next time you run the program, either. It kinda depends on when you plan on rebooting next (if you do it regularly or not).
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Mike Rightmire
Frequent Advisor

Re: How can i kill a process!

Just one last thought (as I have run into this too.) Be sure after the kill statement to use ps and verify the process ID HAS NOT CHANGED.

If there is a parent process on the machine RE-CREATING the process after each kill, the ID will change.

Sometimes what is actually happening is the process is dying, but the parent simply starts it right back up, giving the illusion the process will not die. Killing the parent process (if applicable) will stop the re-creation of the child process.
Mike
"If we treated each person we met as if they were carrying an unspeakable burden, we might almost treat each other as we should." Dale Carnegie
Satish Y
Trusted Contributor

Re: How can i kill a process!

I agree with Mike, you should first try it.

Cheers....
Satish.
Difference between good and the best is only a little effort
Sukumar Alagappan
New Member

Re: How can i kill a process!

I had similar experiences and the following article on Technical Knowledge base
keyword search = rcfaxperformance001

gives some information on what you are looking for. Ofcourse only thing that you can do is investigate what this process is doing and try to fix it in your program or try to get a patch for HPUX or for the third party program or library that you are dealing with.