From 183c173975f5af4c4d37e5e3dfd453c252d29923 Mon Sep 17 00:00:00 2001
From: linggao <linggao@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Date: Tue, 10 Nov 2009 15:07:16 +0000
Subject: [PATCH] fixed MYSQL server went away error'

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4536 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
---
 perl-xCAT/xCAT/Utils.pm             |  2 +-
 xCAT-server/lib/xcat/plugins/zvm.pm | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm
index 7f2e0164f..b4bcc31e7 100644
--- a/perl-xCAT/xCAT/Utils.pm
+++ b/perl-xCAT/xCAT/Utils.pm
@@ -335,7 +335,7 @@ sub xfork
         #my %drivers = DBI->installed_drivers;
         foreach (values %{$::XCAT_DBHS})
         {    #@{$drh->{ChildHandles}}) {
-            if ($_) { $_->disconnect(); }
+            #if ($_) { $_->disconnect(); }
             $_->{InactiveDestroy} = 1;
             undef $_;
         }
diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm
index 9cbb3b3c3..8806dfab3 100644
--- a/xCAT-server/lib/xcat/plugins/zvm.pm
+++ b/xCAT-server/lib/xcat/plugins/zvm.pm
@@ -140,7 +140,7 @@ sub process_request {
 	# Controls the power for a single or range of nodes
 	if ( $command eq "rpower" ) {
 		foreach (@nodes) {
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {
@@ -166,7 +166,7 @@ sub process_request {
 	# Remote hardware inventory
 	elsif ( $command eq "rinv" ) {
 		foreach (@nodes) {
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {
@@ -193,7 +193,7 @@ sub process_request {
 	elsif ( $command eq "mkvm" ) {
 		foreach (@nodes) {
 
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {
@@ -235,7 +235,7 @@ sub process_request {
 	# Removes zVM virtual server
 	elsif ( $command eq "rmvm" ) {
 		foreach (@nodes) {
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {
@@ -261,7 +261,7 @@ sub process_request {
 	# Lists zVM user directory entry
 	elsif ( $command eq "lsvm" ) {
 		foreach (@nodes) {
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {
@@ -287,7 +287,7 @@ sub process_request {
 	# Changes zVM user directory entry
 	elsif ( $command eq "chvm" ) {
 		foreach (@nodes) {
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {
@@ -313,7 +313,7 @@ sub process_request {
 	# Collects node information from one or more hardware control points
 	elsif ( $command eq "rscan" ) {
 		foreach (@nodes) {
-			$pid = fork();
+			$pid = xCAT::Utils->xfork();
 
 			# Parent process
 			if ($pid) {