-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
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user