From 4e4dc4d5d1f75c18a6af11d7a8694b0dab020ab7 Mon Sep 17 00:00:00 2001 From: Sonic Wu Date: Mon, 23 Oct 2017 02:52:09 -0500 Subject: [PATCH] Merge pull request #107 from sonicwu:master Fix 'start.sh' waits indefinitely when specified the 'dubbo.protocol.host' parameter --- .../src/main/resources/META-INF/assembly/bin/start.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dubbo-container/dubbo-container-api/src/main/resources/META-INF/assembly/bin/start.sh b/dubbo-container/dubbo-container-api/src/main/resources/META-INF/assembly/bin/start.sh index 8bbea8d0a5..06fd79c399 100755 --- a/dubbo-container/dubbo-container-api/src/main/resources/META-INF/assembly/bin/start.sh +++ b/dubbo-container/dubbo-container-api/src/main/resources/META-INF/assembly/bin/start.sh @@ -7,9 +7,14 @@ CONF_DIR=$DEPLOY_DIR/conf SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` SERVER_PROTOCOL=`sed '/dubbo.protocol.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` +SERVER_HOST=`sed '/dubbo.protocol.host/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` +if [ -z "$SERVER_HOST" ]; then + SERVER_HOST=`127.0.0.1` +fi + if [ -z "$SERVER_NAME" ]; then SERVER_NAME=`hostname` fi @@ -69,7 +74,7 @@ while [ $COUNT -lt 1 ]; do sleep 1 if [ -n "$SERVER_PORT" ]; then if [ "$SERVER_PROTOCOL" == "dubbo" ]; then - COUNT=`echo status | nc -i 1 127.0.0.1 $SERVER_PORT | grep -c OK` + COUNT=`echo status | nc -i 1 $SERVER_HOST $SERVER_PORT | grep -c OK` else COUNT=`netstat -an | grep $SERVER_PORT | wc -l` fi