1760558 Members
2839 Online
108894 Solutions
New Discussion юеВ

Kill running process

 
Patricia_2
Occasional Advisor

Kill running process

Hi,

I'm using command kill -9 PID to kill one of my running process.Unfortunely the process still running.

I try to kill the Shell PID to disconnect the session, unfortunely the process still running ,but the session is actually disconnected.

Please guide and Thanks in advance.

Regards,
Pat
11 REPLIES 11
Philip Chan_1
Respected Contributor

Re: Kill running process

Does the user who issue the "kill -9" command have sufficient authority to do so?

Rgds
Philip
Patricia_2
Occasional Advisor

Re: Kill running process

I'm using root user id to run the kill command
Philip Chan_1
Respected Contributor

Re: Kill running process

I seem before that de-functioned processes cannot be terminated by kill -9 command, in that case I had to kill their parent process in order to get rid of them.

What was the status for your process?
Patricia_2
Occasional Advisor

Re: Kill running process

Hi Chan,

I have kill the parent pid , and this cause the PPID for the process become 1.



Anthony Goonetilleke
Esteemed Contributor

Re: Kill running process

if it is owned by 1 it means it is a child of init. Usually a reboot is needed to get rid of these runaway proc's
Minimum effort maximum output!
Stefan Farrelly
Honored Contributor

Re: Kill running process


This process must now be stuck on a socket. Theres no easy to free up a stuck socket under HP-UX. The only options are to;

1. reboot the PC or WS that the user was using who started the process. This may free up the stuck socket allowing the process to die. (give it some time after the reboot before moving onto option 2.)
2. reboot the HP server.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Andy Monks
Honored Contributor

Re: Kill running process

Kill -9, should be the last resort not the first.

However, all kills can fail (including -9), if the process is waiting on a system call that is uninterruptable. There is no way to kill/remove these processes if what the system call is waiting for, is missed or never turns up. Only a reboot will clear them.

Kill -9 however, can make things worse, as it doesn't give the process enough time to tidy up. It won't release shared memory, semaphores, file locks etc, and you can be heading for a reboot due just to doing a kill -9.

If a process won't die with a kill -15 or -1, then try and see if it's still running before doing a -9. If it's 'sleeping' don't using -9, as it's not going to die anyway. If it's running, then someone is just trapping the signals and -9 will probably kill it. However, as I stated above, the process won't clean up after it's self.

Btw, you can't trap kill -9.
Horst Prestin
Occasional Advisor

Re: Kill running process

Sometimes if I have such a "zombie" I have to reboot.
This really helps.
AIX-Sysadmin
Philip Chan_1
Respected Contributor

Re: Kill running process


Can we awake a sleeping process by kill -26 (SIGCONT) and hope it catch the abort signal from the OS?

-Philip