Apache Lucene open-source search software
SOLR-7635: Limit lsof port check in bin/solr to just listening ports
Ramkumar Aiyengar859415c7e13c
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 8d6bc80506a..06fa8d47077 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -129,6 +129,9 @@ Bug Fixes* SOLR-7667: Add missing _root_ field to managed-schema template so that the default data drivenconfig set can index nested documents by default. (yonik)+* SOLR-7635: Limit lsof port check in bin/solr to just listening ports+ (Upayavira, Ramkumar Aiyengar)+Optimizations----------------------* SOLR-7660: Avoid redundant 'exists' calls made to ZK while fetching cluster state updates. (shalin)diff --git a/solr/bin/solr b/solr/bin/solrindex b4d9e858e45..64d37951f07 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -1011,7 +1011,7 @@ if [ "$EXAMPLE" != "" ]; then# check to see if something is already bound to that portif hash lsof 2>/dev/null ; then # hash returns true if lsof is on the path- PORT_IN_USE=`lsof -Pni:$CLOUD_PORT`+ PORT_IN_USE=`lsof -PniTCP:$CLOUD_PORT -sTCP:LISTEN`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@@ -1408,7 +1408,7 @@ function launch_solr() {(loops=0while truedo- running=`lsof -Pni:$SOLR_PORT`+ running=`lsof -PniTCP:$SOLR_PORT -sTCP:LISTEN`if [ -z "$running" ]; thenif [ $loops -lt 6 ]; thensleep 5