Skip to content

Commit 4e4dc4d

Browse files
sonicwuchickenlj
authored andcommitted
Merge pull request #107 from sonicwu:master
Fix 'start.sh' waits indefinitely when specified the 'dubbo.protocol.host' parameter
1 parent dee60b2 commit 4e4dc4d

File tree

1 file changed

+6
-1
lines changed
  • dubbo-container/dubbo-container-api/src/main/resources/META-INF/assembly/bin

1 file changed

+6
-1
lines changed

dubbo-container/dubbo-container-api/src/main/resources/META-INF/assembly/bin/start.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ CONF_DIR=$DEPLOY_DIR/conf
77

88
SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
99
SERVER_PROTOCOL=`sed '/dubbo.protocol.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
10+
SERVER_HOST=`sed '/dubbo.protocol.host/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
1011
SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
1112
LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
1213

14+
if [ -z "$SERVER_HOST" ]; then
15+
SERVER_HOST=`127.0.0.1`
16+
fi
17+
1318
if [ -z "$SERVER_NAME" ]; then
1419
SERVER_NAME=`hostname`
1520
fi
@@ -69,7 +74,7 @@ while [ $COUNT -lt 1 ]; do
6974
sleep 1
7075
if [ -n "$SERVER_PORT" ]; then
7176
if [ "$SERVER_PROTOCOL" == "dubbo" ]; then
72-
COUNT=`echo status | nc -i 1 127.0.0.1 $SERVER_PORT | grep -c OK`
77+
COUNT=`echo status | nc -i 1 $SERVER_HOST $SERVER_PORT | grep -c OK`
7378
else
7479
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
7580
fi

0 commit comments

Comments
 (0)