From 1fa9bdb32f88d070b0bb2b991a3865b0a0374991 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 27 Sep 2013 09:56:45 -0400 Subject: [PATCH] temp fix for defect 3797, at least get it working on SLES --- xCAT/postscripts/xcatflowrequest | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xCAT/postscripts/xcatflowrequest b/xCAT/postscripts/xcatflowrequest index caa4b41cf..d44c7d6bd 100755 --- a/xCAT/postscripts/xcatflowrequest +++ b/xCAT/postscripts/xcatflowrequest @@ -5,22 +5,21 @@ # It is called by xcatdsklspost before calling getpostscripts.awk # it is called by remoteshell before calling getcredentials.awk # -exec {REMOTEFD}<>/dev/udp/$1/$2 -echo "resourcerequest: xcatd" >&$REMOTEFD +exec 50<>/dev/udp/$1/$2 +echo "resourcerequest: xcatd" >&50 parpid=$$ touch /tmp/goahead.$parpid touch /tmp/killme.$parpid exec 2> /dev/null while ! grep 'resourcerequest: ok' /tmp/goahead.$parpid > /dev/null; do ( - echo "resourcerequest: xcatd" >&$REMOTEFD - exec {LOCALFD}<>/proc/self/stat - read mystat<&$LOCALFD + echo "resourcerequest: xcatd" >&50 + exec 51<>/proc/self/stat + read mystat<&51 mypid=$(echo $mystat|cut -d " " -f 4) (sleep $(((RANDOM%60)+120)).$((RANDOM%50)); if [ -f /tmp/killme.$parpid ]; then kill -TERM $mypid; fi) & echo $! > /tmp/sleeperpid.$parpid - exec awk '{print $0 > "/tmp/goahead.'$parpid'";exit}' <&$REMOTEFD - exec {LOCALFD}>&- + exec awk '{print $0 > "/tmp/goahead.'$parpid'";exit}' <&50 ) done sleeper=$(cat /tmp/sleeperpid.$parpid) @@ -28,5 +27,4 @@ sleeper=$(ps -ef|awk "\$3==$sleeper"|awk '{print $2}') rm /tmp/goahead.$parpid rm /tmp/sleeperpid.$parpid rm /tmp/killme.$parpid -exec {REMOTEFD}>&- kill -TERM $sleeper