SOLR-13089: Fix lsof edge cases in the solr CLI script

This commit is contained in:
Martijn Koster 2020-01-06 13:20:14 +01:00 committed by Jan Høydahl
parent 6bb1f6cbbe
commit ac777a5352
2 changed files with 4 additions and 2 deletions

View File

@ -212,6 +212,8 @@ Bug Fixes
* SOLR-14122: SimUtils converts v2 to v1 request params incorrectly. (Li Cao, ab)
* SOLR-13089: Fix lsof edge cases in the solr CLI script (Martijn Koster via janhoy)
Other Changes
---------------------

View File

@ -2241,13 +2241,13 @@ function start_solr() {
echo ""
fi
# no lsof on cygwin though
if hash lsof 2>/dev/null ; then # hash returns true if lsof is on the path
if lsof -v 2>&1 | grep -q revision; then
echo -n "Waiting up to $SOLR_STOP_WAIT seconds to see Solr running on port $SOLR_PORT"
# Launch in a subshell to show the spinner
(loops=0
while true
do
running=`lsof -PniTCP:$SOLR_PORT -sTCP:LISTEN`
running=$(lsof -t -PniTCP:$SOLR_PORT -sTCP:LISTEN)
if [ -z "$running" ]; then
slept=$((loops * 2))
if [ $slept -lt $SOLR_STOP_WAIT ]; then