kill -9
if not then the process is in a kernel state most likely waiting for I/O
> How to kill process which not killed by 'kill' ?
if not then the process is in a kernel state most likely waiting for I/O
if a simple kill pid doesn't work, it usually means the process is trapping the
kill signal. the -9 option says kill, damn any traps that might be in your way.
>if a simple kill pid doesn't work, it usually means the process is trapping the
>kill signal. the -9 option says kill, damn any traps that might be in your way.
In my experience, this often occurs when the kernel gets stuck in
a cv_wait(9F). So use cv_wait_sig(9F), cv_timedwait(9F) or cv_timedwait_sig(9F)
to get around this (if it is indeed the cause of the problem.)
Arindum
My guess is that if the process is sleeping, the scheduler doesn't
give it any cpu time for processing until the designated wake-up time,
so it never gets the chance to receive the kill until then. If anyone
can confirm/deny this, and explain it in a less dumb way, I'd be
grateful.
This feature can be a real * if you've just written a really
clever script to automate the killing of particular processes and
decide to test it by killing simple scripts with long sleeps in them
(BTDT).
Cheers, Jim.
> My guess is that if the process is sleeping, the scheduler doesn't
> give it any cpu time for processing until the designated wake-up time,
> so it never gets the chance to receive the kill until then. If anyone
> can confirm/deny this, and explain it in a less dumb way, I'd be
> grateful.
> This feature can be a real * if you've just written a really
> clever script to automate the killing of particular processes and
> decide to test it by killing simple scripts with long sleeps in them
> (BTDT).
> Cheers, Jim.
> >How to kill process which not killed by 'kill' ?
BSD-based kernel's alway clear the interruptible wait state of
the target process of a caught or terminating signal. In other words,
you can be in the longest 'sleep()' ever recorded when the
signal comes in, and you would be awakened immediately.
When you again ran, you'd die or take the signal. As I recall,
for SIGKILL the process priority was raised to expedite the
process' demise.
It's hard to imagine that Solaris doesn't use the same approach.
__________________________________________________
Bright Tiger Technologies: Resource-management software
for building and managing fast, reliable web sites
See us at http://www.veryComputer.com/
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
> > Coming at this from a different angle, I've noticed that if I run a
> > shell script with a really long sleep in it, and try to kill it (even
> > with -9), it doesn't die until the sleep is finished. I've never
> > bothered to find out definitely why this is.
> > My guess is that if the process is sleeping, the scheduler doesn't
> > give it any cpu time for processing until the designated wake-up time,
> > so it never gets the chance to receive the kill until then. If anyone
> > can confirm/deny this, and explain it in a less dumb way, I'd be
> > grateful.
Yup.Quote:> > This feature can be a real * if you've just written a really
> > clever script to automate the killing of particular processes and
> > decide to test it by killing simple scripts with long sleeps in them
The only thing I know of that won't be killed dead by a SIGKILL is aQuote:> Back in my Digital UNIX kernel days, we considered a process
> that was unkillable with SIGKILL to be the victim of a serious OS bug.
> You should never have to reboot to clear one of these processes,
> but this appears to be acceptable on Solaris. Oh, well.
The Solaris signals are stored as a bitmask. MultipleQuote:> BSD-based kernel's alway clear the interruptible wait state of
> the target process of a caught or terminating signal. In other words,
> you can be in the longest 'sleep()' ever recorded when the
> signal comes in, and you would be awakened immediately.
> When you again ran, you'd die or take the signal. As I recall,
> for SIGKILL the process priority was raised to expedite the
> process' demise.
I don't see any avantage to changing the process priority for a
process recieving a signal, since that process will get placed
back in the run queue rather quickly anyway. The regular
scheduler should be able to handle it well. I could imagine one
thinking the scheduler paid special attention to KILLed processes,
but I suspect that would be a natural fallout of the UNIX
scheduler. Come to think of it, I rarely find machines with such
a large run queue that I would have to wait long at all to get a
signal serviced. 15 years ago, that wasn't always the case ;-)
The real irritating thing about SIGKILL is that the process has
no ability to run any signal handling code. For example, Netscape
navigator sets a lock file in the users $HOME/.netscape directory.
Sending SIGKILL to netscape will leave the lock since netscape has
no ability to run any code to clean up the lock. Later instances
of netscape will complain about the lock. Yet another reason not
to use SIGKILL unless other signals haven't worked. I recommend a
set to try: TERM (default), HUP, INT, QUIT, ABRT, and then maybe KILL.
Most processes do the right thing with TERM. ABRT will force a core
dump. KILL kills it dead.
Solaris signal handling is largely derived from Posix with some
BSDisms added for variety.
-- richard
A killed process will die, the only time a process won't die is whenQuote:>BSD-based kernel's alway clear the interruptible wait state of
>the target process of a caught or terminating signal. In other words,
>you can be in the longest 'sleep()' ever recorded when the
>signal comes in, and you would be awakened immediately.
>When you again ran, you'd die or take the signal. As I recall,
>for SIGKILL the process priority was raised to expedite the
>process' demise.
>It's hard to imagine that Solaris doesn't use the same approach.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
I've seen NFS-mounted program not respond to SIGKILL on Solaris 2.5
when NFS server became unavailable. Was it really Solaris or just me?
If the filesystem is not mounted "intr" (and that wasn't the default a long
time ago), then the program will hang until the server recovers, if
the program hangs in disk wait.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
1. A method to kill process that cannot be killed even with `kill -9'.
Try this method:
kill -9 non-killed-pid
/usr/proc/bin/prun non-killed-pid
/usr/proc/bin/pmap non-killed-pid
This method works perfectly with Solaris 6. Sometimes you can do it
without the "kill -9 non-killed-pid"
P.S. I don't know about other versions and about some hardware programs,
like tar.
--
------------------------------------------------------
Eugene S. Ilchenko, System Network Administrator
http://secinf.net/
3. Can''t kill process w/ KILL
4. What's all this incoming traffic on port 80...
5. how to kill a process when kill -9 won't
6. vi "TMP file too large" error
7. Kill -9 won't kill a process
9. kill -9 doesn't kill a process!
10. kill -9 doesn't kill a process
11. kill -9 doesn't kill a process ?
12. Can a process kill its child if it's killed -9
13. Can't Kill Zombie processes, even with kill -9 (pid)