Apache Solr open-source search software
Start script fails to detect solr on non-default port and then after 30s tails wrong log file
Jan Høydahl3deda56ac99b
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 7464c1de03e..cbec9643c3e 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -259,6 +259,9 @@ Bug Fixes* SOLR-6224: Post soft-commit callbacks are called before soft commit actually happens.(shalin)+* SOLR-6646: bin/solr start script fails to detect solr on non-default port and then after+ 30s tails wrong log file (janhoy)+Optimizations----------------------diff --git a/solr/bin/solr b/solr/bin/solrindex da555e29895..c67b852f687 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -317,7 +317,7 @@ function stop_solr() {SOLR_PID="$4"if [ "$SOLR_PID" != "" ]; then- echo -e "Sending stop command to Jetty stop port $STOP_PORT ... waiting 5 seconds to allow process $SOLR_PID to stop gracefully."+ echo -e "Sending stop command to Solr running on port $SOLR_PORT ... waiting 5 seconds to allow Jetty process $SOLR_PID to stop gracefully."$JAVA -jar $DIR/start.jar STOP.PORT=$STOP_PORT STOP.KEY=$STOP_KEY --stop || true(sleep 5) &spinner $!@@ -620,7 +620,7 @@ if [ "$EXAMPLE" != "" ]; then# check to see if something is already bound to that portif [ "$hasLsof" != "" ]; then- PORT_IN_USE=`lsof -i:$CLOUD_PORT | grep $CLOUD_PORT`+ PORT_IN_USE=`lsof -Pni:$CLOUD_PORT`if [ "$PORT_IN_USE" != "" ]; thenread -e -p "Oops! Looks like port $CLOUD_PORT is already being used by another process. Please choose a different port. " USER_INPUTelse@@ -898,14 +898,14 @@ $SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \(loops=0while truedo- running=`lsof -i:$SOLR_PORT | grep $SOLR_PORT`+ running=`lsof -Pni:$SOLR_PORT`if [ "$running" == "" ]; thenif [ $loops -lt 6 ]; thensleep 5loops=$[$loops+1]elseecho -e "Still not seeing Solr listening on $SOLR_PORT after 30 seconds!"- tail -30 $SOLR_TIP/node1/logs/solr.log+ tail -30 $SOLR_SERVER_DIR/logs/solr.logexit;fielse