$OpenBSD: patch-bin_solr,v 1.16 2021/11/14 11:19:29 sthen Exp $

Index: bin/solr
--- bin/solr.orig
+++ bin/solr
@@ -125,8 +125,8 @@ elif [ -n "$JAVA_HOME" ]; then
     exit 1
   fi
 else
-  JAVA=java
-  JSTACK=jstack
+  JAVA=$(${LOCALBASE}/bin/javaPathHelper -c solr)
+  JSTACK=$(${LOCALBASE}/bin/javaPathHelper -h solr)/bin/jstack
 fi
 
 if [ -z "$SOLR_STOP_WAIT" ]; then
@@ -2289,13 +2289,13 @@ function start_solr() {
 	echo ""
     fi
     # no lsof on cygwin though
-    if lsof -v 2>&1 | grep -q revision; then
+    if true; then
       echo -n "Waiting up to $SOLR_START_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 -t -PniTCP:$SOLR_PORT -sTCP:LISTEN)
+        running=$(fstat|awk "/internet stream tcp.*:$SOLR_PORT\$/ { print $3 }")
         if [ -z "$running" ]; then
 	  slept=$((loops * 2))
           if [ $slept -lt $SOLR_START_WAIT ]; then
