General
cancel
Showing results for 
Search instead for 
Did you mean: 

A funny thing happened to me at the help desk today,...

SOLVED
Go to solution
Ian Dennison_1
Honored Contributor

A funny thing happened to me at the help desk today,...

someone asked me what the difference was between a "kill -9" and a "kill -15".

I said "six".

Share and Enjoy! Ian
Building a dumber user
22 REPLIES
James R. Ferguson
Acclaimed Contributor
Solution

Re: A funny thing happened to me at the help desk today,...

Hi Ian:

> I said "six".

I agree --- you wish you would have had the chance to "deep-six" the shared memory segments and the temporary files your process left around :-)

Regards!

...JRF...
Jan van den Ende
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

Ian,

In my view the correct answer would be:
"Anyone who needs to ask, should have access to neither."

But hay, now in the real world...


Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Court Campbell
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

zombies, and orphans, and mem leaks, OH MY!
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Fabio Ettore
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

The difference?

kill -15 ---> "Killing me softly"
kill -9 ---> "Killing me hardly"

:-)
WISH? IMPROVEMENT!
Steven E. Protter
Exalted Contributor

Re: A funny thing happened to me at the help desk today,...

Shalom,

Good one.

The process is just as dead unless its a zombie.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andres_13
Respected Contributor

Re: A funny thing happened to me at the help desk today,...

That was accurate.

Regards!
Dennis Handly
Acclaimed Contributor

Re: A funny thing happened to me at the help desk today,...

>Court: zombies

Zombies aren't created by kill -TERM or -KILL.
And you can try to kill the zombie master.
Deepak Kr
Respected Contributor

Re: A funny thing happened to me at the help desk today,...

Haha :-)

kill -9 shoot at sight
kill -15 hang till death!!


regds.
Deepak
"There is always some scope for improvement"
Venkatesh BL
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

there is a manpage for 'kill'

signum signame Name Description
___________________________________________________________________________
0 SIGNULL Null Check access to pid
1 SIGHUP Hangup Terminate; can be trapped
2 SIGINT Interrupt Terminate; can be trapped
3 SIGQUIT Quit Terminate with core dump; can be trapped
9 SIGKILL Kill Forced termination; cannot be trapped
15 SIGTERM Terminate Terminate; can be trapped
24 SIGSTOP Stop Pause the process; cannot be trapped
25 SIGTSTP Terminal stop Pause the process; can be trapped
26 SIGCONT Continue Run a stopped process
Laurent Menase
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

most of the answer is there:
9 SIGKILL Kill Forced termination; cannot be trapped
15 SIGTERM Terminate Terminate; can be trapped

===================================
|cannot be trapped/can be trapped.|
===================================

But I like 6
Court Campbell
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

Dennis,

Are you telling me that it is impossible to sigkill a parent process and have it's children become zombies?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Ian Dennison_1
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

"Kill em all, let 'init' sort em out!"
Building a dumber user
Laurent Menase
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

Zombies are created in any case whatever be the signal received

The live time of a zombie only depends of its parent configuration of SIGCLD.

If parent don't ignore SIGCLD, it will stay until the parent make a wait3() or withpid().

If parent ignore SIGCLD, zombie will disappear.

If parent is dead, zombie parent will be 1 (init) and init will clean the zombie.

I hope this answers.
V. Nyga
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

LOL Ian!

From man-pages it seems like one should use 15 before 9 ....
And - is anyone using the -s option?
Because "-signum is Obsolescent" ??

Volkmar
*** Say 'Thanks' with Kudos ***
Rob Leadbeater
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

Reminds me of the time a certain Helpdesk member was trying to clear up some rogue processes and killed THE parent process, ie.

# kill -9 1

It was sort of funny the first time they did it...

Cheers,
Rob
Court Campbell
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

Thank Laurent. I know what a zombie is. I just wanted Dennis to admit that it is possible. I was conferring with a friend and it is possible to create a zombie via sigkill if a processes parent isn't handling SIGCHLD correctly. But as he noted that would not be limited to sigkill. I just didn't appreciate being called out.

Ian, no points please.

"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
TwoProc
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

kill -15 - tell a program to terminate, close files, and exit (presumed program handles it correctly). The program may choose to ignore.

kill -9 = kill program, no chance for cleanup, file closing, flushing, mem-releasing, etc. by the program itself. The program can't ignore this signal.

Always best to try kill -15 (default) first.

Re: zombie - you have to kill the zombie parent controller - HOWEVER, if the program has a parent - why is it a zombie????
We are the people our parents warned us about --Jimmy Buffett
Laurent Menase
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

> Re: zombie - you have to kill the zombie
> parent controller - HOWEVER, if the program
> has a parent - why is it a zombie????

Just make a small program:
#include
main()
{
signal(SIGCLD, SIG_BLOCK);
if (fork())
sleep(10000);
}
# ps -l


or

#include

handler() {
}
main()
{
int s;
signal(SIGCLD, handler);
if (fork())
{
if( sleep(100)) sleep(100);
wait(&s);
}
}

This one is doing something else, so it doesn't get the stats of the process.

Pete Randall
Outstanding Contributor

Re: A funny thing happened to me at the help desk today,...

While the original topic of this post was mildly amusing in a technical, geeky sense, we seem to have strayed far, far off topic.

Ian, would you consider closing this thread?


Pete

No points, please.

Pete
Dennis Handly
Acclaimed Contributor

Re: A funny thing happened to me at the help desk today,...

>Campbell: Are you telling me that it is impossible to sigkill a parent process and have it's children become zombies?

That's correct. They are orphans not zombies.
But if they already were zombies, killing the zombie master kills the zombies (init reaps them).

>Rob: killed THE parent process

That can't happen anymore, see kill(2).

Ian Dennison_1
Honored Contributor

Re: A funny thing happened to me at the help desk today,...

Reluctantly thread closed. Hopefully it will be of use to interested parties in years to come.

Next discussion thread, what if there a 3rd binary state, not "one" or "zero" but "maybe". Discuss.

Building a dumber user
Srimalik
Valued Contributor

Re: A funny thing happened to me at the help desk today,...

kill -15 : You request a process to die and do whatever it wants to do before dying the process can also opt to leave as it is free to do "whatever you want to do before dying"
else
If I am serious an want you to really die in any case you will be kill -9ed and won't get any chance to arrange for ur own last rituals.
abandon all hope, ye who enter here..