mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	Merge pull request #744 from cxhong/swkits
Detect Error case in the xcatd and avoid loop in the updateflag.awk
This commit is contained in:
		| @@ -378,6 +378,11 @@ sub do_installm_service { | ||||
|         } else { | ||||
|             ($client_name,$client_aliases) = gethostbyaddr($conn->peeraddr,AF_INET); | ||||
|         } | ||||
|         unless ($client_name) { | ||||
|             my $myaddr = inet_ntoa($conn->peeraddr); | ||||
|             xCAT::MsgUtils->message("S","xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored"); | ||||
|             print "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored\n"; | ||||
|         } | ||||
|  | ||||
|         $clients[0] = $client_name; | ||||
|         if ($client_aliases) { | ||||
| @@ -404,7 +409,11 @@ sub do_installm_service { | ||||
|             if ($node) {  # Means the source isn't valid | ||||
|                 $validclient=1; | ||||
|                 last; | ||||
|             } else { | ||||
|                 xCAT::MsgUtils->message("S","xcatd received a connection request from $client, which can not be found in xCAT nodelist table. The connection request will be ignored"); | ||||
|                 print "xcatd received a connection request from $client, which can not be found in xCAT nodelist table. The connection request will be ignored\n"; | ||||
|             } | ||||
|              | ||||
|         } | ||||
|  | ||||
|         unless ($validclient) { | ||||
|   | ||||
| @@ -6,27 +6,32 @@ BEGIN { | ||||
|     xcatdport = ARGV[2] | ||||
|     flag = ARGV[3] | ||||
|      | ||||
| 	if (!flag) flag = "next" | ||||
|     if (!flag) flag = "next" | ||||
|  | ||||
| 	ns = "/inet/tcp/0/" ARGV[1] "/" xcatdport | ||||
|     ns = "/inet/tcp/0/" ARGV[1] "/" xcatdport | ||||
|  | ||||
| 	while(1) { | ||||
| 		if((ns |& getline) > 0) | ||||
| 			print $0 | "logger -t xcat -p local4.info" | ||||
|     loop = 0 | ||||
|     while(1) { | ||||
|         if((ns |& getline) > 0) | ||||
|             print $0 | "logger -t xcat -p local4.info" | ||||
|         else { | ||||
|             print "Retrying flag update" | "logger -t xcat -p local4.info" | ||||
|             close(ns) | ||||
|             system("sleep 10") | ||||
|         } | ||||
|             loop = loop + 1 | ||||
|         }    | ||||
|  | ||||
| 		if($0 == "ready") | ||||
| 			print flag |& ns | ||||
| 		if($0 == "done") | ||||
| 			break | ||||
| 	} | ||||
|         if($0 == "ready") | ||||
|             print flag |& ns | ||||
|         if($0 == "done") | ||||
|             break | ||||
|         if(loop > 10)  | ||||
|             print "flag update failed" | "logger -t xcat -p local4.info" | ||||
|             break | ||||
|     } | ||||
|  | ||||
| 	close(ns) | ||||
|     close(ns) | ||||
|  | ||||
| 	exit 0 | ||||
|     exit 0 | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user