1748227 Members
4270 Online
108759 Solutions
New Discussion юеВ

how to kill a process

 
Stefano_10
Advisor

how to kill a process

I have some problem on my server, and i have some processes (as ps, or ll) that don't respond.
I have tried to kill them, also with kill -9 but they are still running.
How can i kill them without restart the server?
Thanks
Stefano
9 REPLIES 9
RAC_1
Honored Contributor

Re: how to kill a process

If the process is not responding to kill -9 it means it has hunged/zimbie process.

Just a word of caution do not use kill -9 to kill at the first instance. This abruptly kills the process and leave behind memeory segments occupied.

Regards,
There is no substitute to HARDWORK
Chris Wilshaw
Honored Contributor

Re: how to kill a process

This can happen as a result of a hardware or software error. The processes are unable to receive and process the kill signal, as they are locked waiting on (for example) disk I/O.

If it's a hardware error on a mirrored disk, pulling the faulty disk from the system can release the processes (trying this on a non-mirorred system is definitely not advisable).

If it's another process that's locking it (waiting as part of an application for example), shutting down the app may solve the issue.

As you have an ll that appears to be hanging, I'd say that a hardware fault is more likely than an application one.
Nick Wickens
Respected Contributor

Re: how to kill a process

Sounds like your processes have entered the land of the living dead and gone Zombie.

To release them from their enternal torment you will have to reboot I am afraid.
Hats ? We don't need no stinkin' hats !!
V. V. Ravi Kumar_1
Respected Contributor

Re: how to kill a process

hi,

if the process has entered zombie state, u may require to reboot.

regds
Never Say No
Jeff Schussele
Honored Contributor

Re: how to kill a process

Hi Stefano,

If the process is blocked & waiting on I/O, it will not catch the kill signal. A tar command that's hung can do this. Sometimes resetting (power cycle) the tape drive can free the process.
If the PID has gone zombie, you could determine it's parent & if that's not a vital process you might try to stop or kill the parent - the zombie child could go with it. But I'd caution you to make SURE of what the parent process is - i.e. do not kill PID 1.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Stefano_10
Advisor

Re: how to kill a process

Probably the cause of problem could be the dvd.
I haven't any problem with tape.
So what process on dvd can give tha same problem that Jeff Schussele
has suggested that can be done from tar?

Stefano
harry d brown jr
Honored Contributor

Re: how to kill a process

If a process doesn't die with a kill -9, and you followed some of the other adice posted, then your only options are:


Ignore it

or

reboot


live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: how to kill a process

If you have "lsof" you can determine what files the process has open.

find lsof here:

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/

live free or die
harry
Live Free or Die
David Totsch
Valued Contributor

Re: how to kill a process

Stefano:

Any process that has a priority less-than or equal to PZERO (see /usr/include/sys/param.h) is not signalable. Let's say you are trying to kill ll(1). There is a good chance it is reading inodes at a priority of PINOD (which is less than PZERO).

Always move from weakest to strongest kills (SIGHUP, SIGINT, SIGQUIT, ...), and use the names. My personal favorite is SIGABRT (just like -9 [aka SIGKILL], it does not give the process a chance to clean up outstanding I/O, shared memory segments, message queues, etc), but it will also generate a core file so that you have a chance to figure out what the process was up to when you felt the need to exert SuperUser powers. In any instance, SIGABRT and SIGKILL are last resorts (and only a reboot will remove what they won't).

BTW: don't worry about memory pages -- the paging algorighm will page them out if memory demands are up and the pages have not been used.

-dlt-