opnsense-ports/textproc/apache-solr/files/patch-bin_solr
Franco Fichtner 286d856d09 */*: sync with upstream
Taken from: FreeBSD
2017-04-18 22:42:12 +02:00

31 lines
1.2 KiB
Text

--- bin/solr.orig 2017-04-15 09:06:51 UTC
+++ bin/solr
@@ -1757,13 +1757,12 @@ function launch_solr() {
1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
# no lsof on cygwin though
- if hash lsof 2>/dev/null ; then # hash returns true if lsof is on the path
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=`sockstat -ls -P tcp -p $SOLR_PORT | grep LISTEN`
if [ -z "$running" ]; then
slept=$((loops * 2))
if [ $slept -lt $SOLR_STOP_WAIT ]; then
@@ -1781,13 +1780,6 @@ function launch_solr() {
fi
done) &
spinner $!
- else
- echo -e "NOTE: Please install lsof as this script needs it to determine if Solr is listening on port $SOLR_PORT."
- sleep 10
- SOLR_PID=`ps auxww | grep start\.jar | grep -w "\-Djetty\.port=$SOLR_PORT" | grep -v grep | awk '{print $2}' | sort -r`
- echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n"
- return;
- fi
fi
}