From c75ce47c06a35506d367c949b18ff0dfa658d3ff Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 31 Oct 2007 04:24:22 +0000 Subject: [PATCH] Fix udpcat to background for unreachable attempts, without incurring double discoveries or spurious sleep, enabling discovery to succeed if the primary case fails git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@28 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot/overlay/bin/dodestiny | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-nbroot/overlay/bin/dodestiny b/xCAT-nbroot/overlay/bin/dodestiny index 988a9abc6..c994ac2e2 100755 --- a/xCAT-nbroot/overlay/bin/dodestiny +++ b/xCAT-nbroot/overlay/bin/dodestiny @@ -70,10 +70,15 @@ while :; do echo "$SERIAL" fi echo "" ) > /tmp/discout - cat /tmp/discout | udpcat.awk $XCATMASTER $XCATPORT - usleep 5000000 #Give the preferred method 5 seconds to complete before resorting - cat /tmp/discout | udpcat.awk `cat /tmp/dhcpserver` $XCATPORT - usleep 25000000 + cat /tmp/discout | udpcat.awk $XCATMASTER $XCATPORT & #can't figure out how to make a hung gawk behave.. + if usleep 8000000 #Give the preferred method 5 seconds to complete before resorting + then + #if usleep succeeded, that means it wasn't killed and therefore, no answer yet + killall udpcat.awk #reap hung ones + cat /tmp/discout | udpcat.awk `cat /tmp/dhcpserver` $XCATPORT & + usleep 8000000 + fi + killall udpcat.awk #reap hung ones done #Discovery complete, restart requested. exec /bin/restart