Operating System - HP-UX
1752767 Members
4977 Online
108789 Solutions
New Discussion юеВ

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

 
SOLVED
Go to solution
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