From 263b5c109f11395dba3a2267e90b3a1f971eefdf Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 22 Jul 2008 13:56:56 +0000 Subject: [PATCH] -Fix various awk xCAT clients to be proper to avoid many 'Unexpected client disconnect' messages git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1919 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot/overlay/bin/getdestiny.awk | 5 ++++- xCAT-nbroot/overlay/bin/getipmi.awk | 5 ++++- xCAT-nbroot/overlay/bin/nextdestiny.awk | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-nbroot/overlay/bin/getdestiny.awk b/xCAT-nbroot/overlay/bin/getdestiny.awk index 144a169c0..df58c12e9 100755 --- a/xCAT-nbroot/overlay/bin/getdestiny.awk +++ b/xCAT-nbroot/overlay/bin/getdestiny.awk @@ -3,6 +3,7 @@ BEGIN { localport = ARGV[1] ns = "/inet/tcp/0/127.0.0.1/" localport + canexit = 0 print "" |& ns print "getdestiny" |& ns @@ -11,7 +12,9 @@ BEGIN { while (1) { if ((ns |& getline) > 0) { print $0 > "/tmp/destiny" - if ($0 == "") + if ($0 ~ /<\/serverdone>/) + canexit = 1 + if (canexit == 1 && $0 == "") break } else { #Timeout close(ns) diff --git a/xCAT-nbroot/overlay/bin/getipmi.awk b/xCAT-nbroot/overlay/bin/getipmi.awk index 82a7ffb6e..57778ca08 100755 --- a/xCAT-nbroot/overlay/bin/getipmi.awk +++ b/xCAT-nbroot/overlay/bin/getipmi.awk @@ -3,6 +3,7 @@ BEGIN { localport = ARGV[1] ns = "/inet/tcp/0/127.0.0.1/" localport + canexit = 0 print "" |& ns print "getbmcconfig" |& ns @@ -11,7 +12,9 @@ BEGIN { while (1) { if ((ns |& getline) > 0) { print $0 > "/tmp/ipmi.data" - if ($0 == "") + if ($0 ~ /<\/serverdone>/) + canexit = 1 + if (canexit == 1 && $0 == "") break } else { close(ns) diff --git a/xCAT-nbroot/overlay/bin/nextdestiny.awk b/xCAT-nbroot/overlay/bin/nextdestiny.awk index 0f18eac4d..5488b2293 100755 --- a/xCAT-nbroot/overlay/bin/nextdestiny.awk +++ b/xCAT-nbroot/overlay/bin/nextdestiny.awk @@ -3,6 +3,7 @@ BEGIN { localport = ARGV[1] ns = "/inet/tcp/0/127.0.0.1/" localport + canexit = 0 print "" |& ns print "nextdestiny" |& ns @@ -11,7 +12,9 @@ BEGIN { while (1) { if ((ns |& getline) > 0) { print $0 > "/tmp/destiny" - if ($0 == "") + if ($0 ~ /<\/serverdone>/) + canexit = 1 + if (canexit == 1 && $0 == "") break } else { close(ns)