From 35fcad7c7890a04019d0e94e01236b9b67e79b06 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 3 Oct 2009 02:06:43 +0000 Subject: [PATCH] -Fix awk scripts that failed to gracefully recover from network timeouts git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4293 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/install/scripts/post.rh | 5 +++++ xCAT-server/share/xcat/postscripts/updateflag.awk | 5 +++++ xCAT/postscripts/locktftpdir.awk | 5 +++++ xCAT/postscripts/setiscsiparms.awk | 5 +++++ xCAT/postscripts/unlocktftpdir.awk | 5 +++++ xCAT/postscripts/updateflag.awk | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/xCAT-server/share/xcat/install/scripts/post.rh b/xCAT-server/share/xcat/install/scripts/post.rh index 39764b64e..adb137a64 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh +++ b/xCAT-server/share/xcat/install/scripts/post.rh @@ -62,6 +62,11 @@ BEGIN { while(1) { if((ns |& getline) > 0) print \$0 + else { + print "Retrying update" + close(ns) + system("sleep 5") + } if(\$0 == "ready") print "next" |& ns diff --git a/xCAT-server/share/xcat/postscripts/updateflag.awk b/xCAT-server/share/xcat/postscripts/updateflag.awk index 6d6930934..84135042e 100755 --- a/xCAT-server/share/xcat/postscripts/updateflag.awk +++ b/xCAT-server/share/xcat/postscripts/updateflag.awk @@ -11,6 +11,11 @@ BEGIN { while(1) { if((ns |& getline) > 0) print $0 | "logger -t xcat" + else { + print "Retrying flag update" | "logger -t xcat" + close(ns) + system("sleep 10") + } if($0 == "ready") print "next" |& ns diff --git a/xCAT/postscripts/locktftpdir.awk b/xCAT/postscripts/locktftpdir.awk index 7d22b6e56..6faa040bb 100755 --- a/xCAT/postscripts/locktftpdir.awk +++ b/xCAT/postscripts/locktftpdir.awk @@ -8,6 +8,11 @@ BEGIN { while(1) { if((ns |& getline) > 0) print $0 | "logger -t xcat" + else { #socket dead, retry + print "TFTP lockdir request retrying" | "logger -t xcat" + close(ns) + system("sleep 1") + } if($0 == "ready") print "locktftpdir" |& ns diff --git a/xCAT/postscripts/setiscsiparms.awk b/xCAT/postscripts/setiscsiparms.awk index d0eed95ba..7e0204d76 100755 --- a/xCAT/postscripts/setiscsiparms.awk +++ b/xCAT/postscripts/setiscsiparms.awk @@ -10,6 +10,11 @@ BEGIN { while(1) { if((ns |& getline) > 0) print $0 | "logger -t xcat" + else { + print "Retrying iSCSI paramater config script" + close(ns) + system("sleep 1") + } if($0 == "ready") print "setiscsiparms "kernel" "initrd" "kcmd |& ns diff --git a/xCAT/postscripts/unlocktftpdir.awk b/xCAT/postscripts/unlocktftpdir.awk index dfe7ae0b9..2f6945257 100755 --- a/xCAT/postscripts/unlocktftpdir.awk +++ b/xCAT/postscripts/unlocktftpdir.awk @@ -8,6 +8,11 @@ BEGIN { while(1) { if((ns |& getline) > 0) print $0 | "logger -t xcat" + else { + print "Retrying unlock of tftp directory" + close(ns) + system("sleep 5") + } if($0 == "ready") print "unlocktftpdir" |& ns diff --git a/xCAT/postscripts/updateflag.awk b/xCAT/postscripts/updateflag.awk index 91599dee2..0eeb343b4 100755 --- a/xCAT/postscripts/updateflag.awk +++ b/xCAT/postscripts/updateflag.awk @@ -13,6 +13,11 @@ BEGIN { while(1) { if((ns |& getline) > 0) print $0 | "logger -t xcat" + else { + print "Retrying flag update" | "logger -t xcat" + close(ns) + system("sleep 10") + } if($0 == "ready") print flag |& ns