(Really) Kill a Process

(Really) Kill a Process

Post by Christian Rumme » Wed, 07 Jul 1999 04:00:00



Hi,

simple problem: How can I -definitely- kill a process. Sometimes even
kill -9 doesn't work.

A bit more precise: e.g. my netscape sometimes shows kind of strange
behaviour and doesn't react on anything anymore. If I do a 'kill -9 PID'
nothing seems to happen (same with -15, of course). The only way to
really kill the process, seems to be a reboot.

By the way, the process seems to use none of the recources (CPU,
memory), looks like a sleeping proc. (but I need to kill it, because it
uses my POP3-server on another machine, but that's not the point)

Any suggestions ?

thanks,
cr

PS
I don't think it's important, but I use SUSE6.1, on a 2xPII266 Machine
with 128M memory.

--
Christian Rummey, Dipl. Chem.
Institut fuer Organische Chemie, Universitaet Wuerzburg

 
 
 

(Really) Kill a Process

Post by Gary Smit » Wed, 07 Jul 1999 04:00:00


This is a guess, but it's teh best I got... it sounds as if the netscape
process is going "bad" in some way, you might need to be logged in as root
to kill it off.

Try  su root , then kill -9 from there.

I've seen this kind of thing on HP-UX and AIX and the sysadmin person can
always make the process in question go away


> Hi,

> simple problem: How can I -definitely- kill a process. Sometimes even
> kill -9 doesn't work.

> A bit more precise: e.g. my netscape sometimes shows kind of strange
> behaviour and doesn't react on anything anymore. If I do a 'kill -9 PID'
> nothing seems to happen (same with -15, of course). The only way to
> really kill the process, seems to be a reboot.

> By the way, the process seems to use none of the recources (CPU,
> memory), looks like a sleeping proc. (but I need to kill it, because it
> uses my POP3-server on another machine, but that's not the point)

> Any suggestions ?

> thanks,
> cr

> PS
> I don't think it's important, but I use SUSE6.1, on a 2xPII266 Machine
> with 128M memory.

> --
> Christian Rummey, Dipl. Chem.
> Institut fuer Organische Chemie, Universitaet Wuerzburg



 
 
 

(Really) Kill a Process

Post by Helmut Katzgrabe » Wed, 07 Jul 1999 04:00:00


rebooting is unhealthy.... i have experienced the same problem with
netscape and found, that if you renice the process to 20 and then kill
it, it really dies. i.e.:

renice 20 PID
kill -9 PID

hope that works.
cheers, h.

--
==========================================================================

        NOTE: NEW PRIVATE PHONE NUMBER          (+1) 831-471-9651


        Physics Department              http://debussy.ucsc.edu/~dummkopf
        Kerr Hall                                
        Univ. of California             Phone:  (+1) 831-459-4762 OF
        Santa Cruz, CA 95064                    (+1) 831-471-9651 HOME
        USA                             Fax:    (+1) 831-459-3043
==========================================================================

 
 
 

(Really) Kill a Process

Post by Helmut Katzgrabe » Wed, 07 Jul 1999 04:00:00


root power does not help... at least it was the case with me.


> This is a guess, but it's teh best I got... it sounds as if the netscape
> process is going "bad" in some way, you might need to be logged in as root
> to kill it off.

> Try  su root , then kill -9 from there.

> I've seen this kind of thing on HP-UX and AIX and the sysadmin person can
> always make the process in question go away

--
==========================================================================

        NOTE: NEW PRIVATE PHONE NUMBER          (+1) 831-471-9651


        Physics Department              http://debussy.ucsc.edu/~dummkopf
        Kerr Hall                                
        Univ. of California             Phone:  (+1) 831-459-4762 OF
        Santa Cruz, CA 95064                    (+1) 831-471-9651 HOME
        USA                             Fax:    (+1) 831-459-3043
==========================================================================

 
 
 

(Really) Kill a Process

Post by Brya » Wed, 07 Jul 1999 04:00:00



> Hi,

> simple problem: How can I -definitely- kill a process. Sometimes even
> kill -9 doesn't work.

> A bit more precise: e.g. my netscape sometimes shows kind of strange
> behaviour and doesn't react on anything anymore. If I do a 'kill -9 PID'
> nothing seems to happen (same with -15, of course). The only way to
> really kill the process, seems to be a reboot.

Try 'killall -9 netscape-communicator'

Then try upgrading Netscape.  I heard there was a problem in one of the
versions that was put in distributions.  ;)

Quote:

> By the way, the process seems to use none of the recources (CPU,
> memory), looks like a sleeping proc. (but I need to kill it, because it
> uses my POP3-server on another machine, but that's not the point)

What error are you getting when you try running a new one?  Try removing
~/.netscape/lock and see if that lets you run a new copy.

> Any suggestions ?

> thanks,
> cr

> PS
> I don't think it's important, but I use SUSE6.1, on a 2xPII266 Machine
> with 128M memory.

> --
> Christian Rummey, Dipl. Chem.
> Institut fuer Organische Chemie, Universitaet Wuerzburg


-- Bryan Scott
-- CTR Online System Administration
 
 
 

(Really) Kill a Process

Post by Chris Mahmoo » Wed, 07 Jul 1999 04:00:00


is it a zombie?  if so, you can't kill it b/c it's already dead...it's
not a big deal and you certainly don't to reboot.  You may need to
remove the lock file in ~/.netscape/lock.
-ckm
 
 
 

(Really) Kill a Process

Post by mila.. » Fri, 09 Jul 1999 04:00:00




> is it a zombie?  if so, you can't kill it b/c it's already dead...it's
> not a big deal and you certainly don't to reboot.  You may need to
> remove the lock file in ~/.netscape/lock.
> -ckm

Well, it does kind of matter.  I had this problem w/ the stock version
of netscape that came w/ SuSE 6.0.  I couldn't kill it ( didn't think
about renicing it first), and according to kpm, it would steadily
increase my cpu usage to ~98%, and everything else would bog down
accordingly.  So yes, it does matter, and if you can't kill it, you have
to reboot.  BTW, another annoying netscape thing... though this one
would seem to be related more Mandrake 6.0, since my netscape's in
Redhat, SuSE, Slackware, and Caldera work fine.  In Mandrake 6.0, the
'Alt+o' sequence to open a new URL just beeps at me.  Similarly, 'Esc'
doesn't stop a page from loading anymore. WTF? Anyone else have this
problem w/ Mandrake?  I d/l'ed the 4.61 mdk.rpms and got the same thing,
and when I loaded them in plain RH, it happened there, as well.

Monte

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

(Really) Kill a Process

Post by Christian Rumme » Fri, 09 Jul 1999 04:00:00


Thanks to all who responded,

but what I just wanted to know is "what to do if kill -9 doesn't work ?"
(I thought it would end up in a netscape thread, if I would mention
netscape in my first mail)

It has nothing to do with root (no matter where the KILL (kill -9)
-signal comes from [if senders is allowed to kill the proc]) or too old
netscape version (I use 4.6, nothing from any linux-distribution) and it
also isn't a zombie.

Anyway there doesn't seem to be any harder than kill -9 I think ?

cu
cr

--
Christian Rummey, Dipl. Chem.
Institut fuer Organische Chemie, Universitaet Wuerzburg

 
 
 

(Really) Kill a Process

Post by greg por » Fri, 09 Jul 1999 04:00:00


Perhaps you're running into a situation which I've seen before on other
flavors of UNIX.  The scenario goes like this:  A process is sending some
output to a device which gets locked up or disconnected for some reason.
Killing the process will make it call exit(), but the exit() code within the
kernel then ignores all signals, including SIGKILL (kill -9).  The exit()
code then goes through all open files, and closes them.  When it gets to the
file corresponding to the locked/disconnected device, the driver may sleep,
waiting for its output to drain.  Unless the device can be unlocked or
reconnected, nothing can be done.  Doing another kill -9 won't help, since
SIGKILL is being ignored, and the driver is usually sleeping at a
non-interruptible priority anyway.

I used to be able to duplicate it by doing something like hitting ctrl-s on
a terminal while using "cat" to display a large file (the ctrl-s would
suspend the output).  Then, killing cat's parent shell from another terminal
would get it into that situation.  This used to occur on NCR's Tower
systems; at that time, we put in a workaround where you could have exit()
disable all signals except for SIGKILL.  But with our current systems
(WorldMark / 3000 series), I haven't seen the problem occur.

I don't recall whether or not Linux has a "crash" utility which will let you
examine the kernel stack trace for running processes.  If it does, you'd see
exit(), close(), and then some driver routine which eventually called
sleep().

- Greg Porr


>Thanks to all who responded,

>but what I just wanted to know is "what to do if kill -9 doesn't work ?"
>(I thought it would end up in a netscape thread, if I would mention
>netscape in my first mail)

>It has nothing to do with root (no matter where the KILL (kill -9)
>-signal comes from [if senders is allowed to kill the proc]) or too old
>netscape version (I use 4.6, nothing from any linux-distribution) and it
>also isn't a zombie.

>Anyway there doesn't seem to be any harder than kill -9 I think ?

>cu
>cr

>--
>Christian Rummey, Dipl. Chem.
>Institut fuer Organische Chemie, Universitaet Wuerzburg


 
 
 

(Really) Kill a Process

Post by Wolfgang Viechtbaue » Fri, 09 Jul 1999 04:00:00


Quote:> but what I just wanted to know is "what to do if kill -9 doesn't work ?"
> (I thought it would end up in a netscape thread, if I would mention
> netscape in my first mail)

> It has nothing to do with root (no matter where the KILL (kill -9)
> -signal comes from [if senders is allowed to kill the proc]) or too old
> netscape version (I use 4.6, nothing from any linux-distribution) and it
> also isn't a zombie.

> Anyway there doesn't seem to be any harder than kill -9 I think ?

Well, I am not sure what exactly the problem is, but I can replicate this
exact phenomenon with a different program. I use FileRunner (ver 2.5) a
lot and it has a useful function when you double click on an image file -
it will start up xv and display the image. However, when you then quit xv,
it will leave a zombie process, which cannot be killed even with -9 or as
root:


wolf      2092  9.0  0.0     0     0  ?  Z    16:49   0:03 (xv <zombie>)


wolf      2092  4.2  0.0     0     0  ?  Z    16:49   0:03 (xv <zombie>)

...


wolf      2092  1.7  0.0     0     0  ?  Z    16:49   0:03 (xv <zombie>)

The only way I can get rid of that zombie process is to shut down
FileRunner. So in other words, I have to kill the parent process.

-------------------------
Wolfgang Viechtbauer

 
 
 

(Really) Kill a Process

Post by Villy Kru » Sat, 10 Jul 1999 04:00:00




>I used to be able to duplicate it by doing something like hitting ctrl-s on
>a terminal while using "cat" to display a large file (the ctrl-s would
>suspend the output).  Then, killing cat's parent shell from another terminal
>would get it into that situation.  This used to occur on NCR's Tower
>systems; at that time, we put in a workaround where you could have exit()
>disable all signals except for SIGKILL.  But with our current systems
>(WorldMark / 3000 series), I haven't seen the problem occur.

This seems to happen for systems using a STREAMS implementation of the
tty drivers, such as all SVR4 derived systems and AIX4.x.

Another regular case is the tape rewind on close and the tape driver
somehow misses the rewind complete interrupt.

Villy

 
 
 

(Really) Kill a Process

Post by Peter T. Breu » Tue, 13 Jul 1999 04:00:00




: >
: >I used to be able to duplicate it by doing something like hitting ctrl-s on
: >a terminal while using "cat" to display a large file (the ctrl-s would
: >suspend the output).  Then, killing cat's parent shell from another terminal
: >would get it into that situation.  This used to occur on NCR's Tower

: This seems to happen for systems using a STREAMS implementation of the
: tty drivers, such as all SVR4 derived systems and AIX4.x.

: Another regular case is the tape rewind on close and the tape driver
: somehow misses the rewind complete interrupt.

Conversely - if you are in an ioctl or a syscall (with interrupts disabled)
and you are kill -9'ed, then it seems to me that the process is never
scheduled again, so remains in the ioctl, and is left in the process
table.

A bug. Or design flaw.

: Villy

--
Peter

 
 
 

1. How can kill all child processes without killing parent process ?

: Hi all UNIX expert,

: I am now writing a shell script to kill all child processes of a
: particular process.  I have written the following
: script:

: ps -ef | grep o\\ra  | awk '{print $2}' | xargs kill

: where ora is the name of the parent process

: However, this shell script only kills out the parent process,
: Does anyone know how to kill all child process without
: killing that parent process ? Please advise !!! Many thanks !!!
: Have a nice UNIX day !!!

you will have to read all matching processes and only kill the last in the
chain by using PID and PPID; unfortunately we can not assume that the
child is the process with the highest PPID:
assume $2=PID , $3=PPID ( coming from   ps -ef | grep o\\ra  | grep -v grep )

{
        PID[ $2 ]=""
        PPID[ $3 ]=""

END{
# process ids which are also parents should be deleted
        for( pid in PPID ) if ( pid in PID ) delete PID[ pid ]
        for( pid in PID ) { do_whatever_you_like_on_your_own_risk( pid ) }
        }

function do_whatever_you_like_on_your_own_risk( param ){
        code...
        }

2. Measuring Execution Time (Accurately)

3. A method to kill process that cannot be killed even with `kill -9'.

4. tip equivilent for HP-UX

5. How to kill process which not killed by 'kill' ?

6. FAQ: Sun Computer Administration Frequently Asked Questions

7. kill -HUP really kills and https

8. modem usually freezes when initializing

9. How to Kill Process and Its sub-process and its sub-process??

10. How to Kill a process and its sub-process and its sub-process at a time..

11. killing dead process, kill -9 doesn′t work

12. how to kill a process when kill -9 won't

13. Kill -9 won't kill a process