Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: ppk

by jplindstrom (Monsignor)
on Apr 19, 2005 at 11:44 UTC ( [id://449197]=note: print w/replies, xml ) Need Help??


in reply to Re: ppk
in thread ppk

Never never never use kill -9 on a process, unless that process has resisted prior attempts to die via kill 1, 2, and 15.

Is that general advice for all processes, or is it only for programs that you don't know, that haven't failed to die properly earlier, etc?

I.e. if I have a program whose processes consistently fail to die properly, should I still kill it with 1, 2, and 15 before 9?

/J

Replies are listed 'Best First'.
Re^3: ppk
by merlyn (Sage) on Apr 19, 2005 at 13:59 UTC
    if I have a program whose processes consistently fail to die properly, should I still kill it with 1, 2, and 15 before 9
    If you have a program like that, you should rewrite it! {grin}

    But yes, that's the applicable rule. "kill -9" is always the "last resort" kill.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Ok. Let me rephrase my question:

      Why?

      (I'm trying to acquire deep technical knowledge here, not cargo cult ;)

      /J

        merlyn may have a different answer, but you should generally try to tell the process to exit nicely first, because it can catch those signals and potentially do useful things on the way out. Processes are not supposed to be able to catch SIGKILL, but are just immediately terminated without the opportunity do to anything else.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://449197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-19 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found