2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

For issue #712 Detect Error case in the xcatd and avoid loop in the

updateflag.awk
This commit is contained in:
Casandra Qiu 2016-02-26 13:23:20 -05:00
parent d277615b66
commit be0bcf7451
2 changed files with 24 additions and 13 deletions

View File

@ -377,6 +377,9 @@ sub do_installm_service {
} else {
($client_name,$client_aliases) = gethostbyaddr($conn->peeraddr,AF_INET);
}
unless ($client_name) {
xCAT::MsgUtils->message("S","xcatd unable to gethostbyaddr");
}
$clients[0] = $client_name;
if ($client_aliases) {
@ -403,7 +406,11 @@ sub do_installm_service {
if ($node) { # Means the source isn't valid
$validclient=1;
last;
} else {
xCAT::MsgUtils->message("S","Invalid client $client, please check nodels and it's name resolution");
}
}
unless ($validclient) {

View File

@ -6,27 +6,31 @@ 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)
break
}
close(ns)
close(ns)
exit 0
exit 0
}