From 940a0b6dd4f3945021ee9aa516b67df487e6d78e Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Tue, 22 Aug 2017 02:39:36 -0400 Subject: [PATCH] Allow the cumulus discovery listener to accept multiple messages (#3732) --- xCAT/postscripts/documulusdiscovery | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/documulusdiscovery b/xCAT/postscripts/documulusdiscovery index a6f8bae60..c9ab88695 100755 --- a/xCAT/postscripts/documulusdiscovery +++ b/xCAT/postscripts/documulusdiscovery @@ -17,7 +17,8 @@ EOF #listen to the 3001 port for any response from xcatd on MN #the message in the response will be written to /tmp/result.socat.out -socat TCP4-LISTEN:3001,reuseaddr EXEC:"/tmp/helper.socat.sh" & +socat TCP4-LISTEN:3001,reuseaddr,fork EXEC:"/tmp/helper.socat.sh" & +LISTENER_PID=$! #generate key pairs for the SSL connection between switch and xcatd on MN mkdir -p /etc/xcat @@ -86,6 +87,7 @@ gzip -9 /tmp/discopacket if [ -z "$XCATMASTER" ] || [ -z "$XCATPORT" ]; then logger -s -t $log_label -p local4.err "Failed to get xcatd connection information, exit..." + kill $LISTENER_PID rm -rf /tmp/result.socat.out rm -rf /tmp/helper.socat.sh exit 1 @@ -119,6 +121,7 @@ while [ $RETRY -lt $MAX_RETRY ]; do ((RETRY=RETRY+1)) done +kill $LISTENER_PID rm -rf /tmp/result.socat.out rm -rf /tmp/helper.socat.sh