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
This commit is contained in:
jbjohnso 2007-10-31 04:24:22 +00:00
parent 48102cee50
commit c75ce47c06

View File

@ -70,10 +70,15 @@ while :; do
echo "<serial>$SERIAL</serial>"
fi
echo "</xcatrequest>" ) > /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