diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 185184b02..e595a27b6 100644 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -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) { diff --git a/xCAT/postscripts/updateflag.awk b/xCAT/postscripts/updateflag.awk index 66fbc9ebf..035a73e2c 100755 --- a/xCAT/postscripts/updateflag.awk +++ b/xCAT/postscripts/updateflag.awk @@ -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 }