- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Zombies
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 10:45 PM
02-06-2003 10:45 PM
Zombies
If I do a signal(SIGCLD, SIG_IGN), then I assume that any signal sent from the child will be ignored and I don't even have to do a waitpid() or anything.
Now I read that on some systems there's no way to prevent signal handlers from being automatically reset to SIG_DFL when the signal handler gets called.
Does that mean that if my application hits a part of code that is handling some other signals like signal(SIGINT,...), then the application will stop ignoring the signals from the children also ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 01:21 AM
02-07-2003 01:21 AM
Re: Zombies
yes, it seams so. Zombie processes are created when the parent process either does not wait on the child process, or does not ignore the child's termination by setting the 'SIGCLD, SIG_IGN' signal within their program. Zombies remain until the parent exits. Although zombies do not use CPU time, they do occupy a slot in the process table.
Zombie processes are also created when a child process completes, and sends a termination to the parent, before the parent receives the 'SIG_IGN, SIGCLD' signal to ignore the termination.
These processes cannot be killed, as they are already dead. If the parent is killed before it exits properly, and cleans up any zombie child processes, only a reboot will clear the zombies from the system.
Refer to these documents for additional information:
- /usr/share/doc/proc_mgt.txt
- signal man page
- signal(5) man page
Regards ...
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 01:34 AM
02-07-2003 01:34 AM
Re: Zombies
Interesting question! So I've created and compiled some applications on HPUX 10.20&11.0,
Linux Red Hat and SunOS 5.7, including:
"signal(SIGCLD, SIG_IGN)"
without any problem.
Which system you have troubles with?
So if you find such problem on any system,
I suppose you can use another technic -
with wait()-function in exit of child.
Regards,Stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 02:44 AM
02-07-2003 02:44 AM
Re: Zombies
Richard Stevens' "Advanced Programming in the UNIX Environment" is a great book covering all those things. Recommended!
Best regards...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 05:55 AM
02-07-2003 05:55 AM
Re: Zombies
One more comment to Dietmar.
You're absolutelly right, however sigaction() is quite complicated and if you want to know what's going on you have to check every flag descriptpion carefully.
For simple tasks, especially to the people that know signal() syntax the sigset() function is the best choice in my opinion.
And one more word to Armin:
I'm not a HP specialist, but according to my knowledge of Unix systems whenever a processes' parent gets killed, the process itself is automatically 'adopted' by 'init' proces (pid=1). So if it is a zombie, its return value should be read by the 'init' (and that process certainly waits() for its children) causing the zombie to disappear.
However, as I said, it can be somewhat different on HP.
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 05:57 AM
02-07-2003 05:57 AM
Re: Zombies
On my experience, only reboot can kill the zombies process.
I am sorry, so is the only way.
Juanma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2003 05:32 AM
02-08-2003 05:32 AM
Re: Zombies
But have you ever tried killing the parent?
Just because I was curious I did a simple test, wich I've checked with gdb and ps command:
#define _INCLUDE_POSIX1C_SOURCE
#include
#include
#include
int main( void )
{
switch( fork() ) {
case 0:
break; //child-terminate
case -1:
puts( "fork() failed" );
break;
default: // parent-don't wait()
{
sigset_t ss;
int sig;
sigemptyset( &ss );
sigaddset( &ss, SIGINT );
puts( "Waiting for SIGINT" );
sigwait( &ss, &sig ); // this is not removing any zombie
break;
}
}
return 0;
}
And what do you say - after sending SIGINT to the parent my zombie was gone.
Good luck
Adam