From d2cc0f30b6b64dd7704d42a690b55d70fbc8ea66 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 6 Jan 2010 20:03:48 +0000 Subject: [PATCH] -If children should occur, keep them from becoming zombies git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4900 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 6be0ea5fe..73fa0f5da 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -37,6 +37,7 @@ use Sys::Syslog; use Storable qw/freeze thaw/; use IO::Socket; use Data::Dumper; +use POSIX qw/WNOHANG/; BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; @@ -149,6 +150,8 @@ sub init_dbworker { } unless ($dbworkerpid) { #This process is the database worker, it's job is to manage database queries to reduce required handles and to permit cross-process caching + $SIG{CHLD} = sub { while (waitpid(-1,WNOHANG) > 0) {}}; #avoid zombies + #TODO: how children are being born, I'm not sure, but on occasion it happens $0 = "xcatd: DB Access"; use File::Path; mkpath('/tmp/xcat/');