-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
This commit is contained in:
		| @@ -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/'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user