Skip to content

Apache Lucene open-source search software

SOLR-8145: Fix position of OOM killer script when starting Solr in the background

thelabdude80801a2738c1
diff --git a/solr/bin/solr b/solr/bin/solr
index 904c2c389e1..9cf8ae53d76 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1420,8 +1420,9 @@ function launch_solr() {
exec "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar "${SOLR_JETTY_CONFIG[@]}"
else
# run Solr in the background
- nohup "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar \
- "-XX:OnOutOfMemoryError=$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT $SOLR_LOGS_DIR" "${SOLR_JETTY_CONFIG[@]}" \
+ nohup "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS \
+ "-XX:OnOutOfMemoryError=$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT $SOLR_LOGS_DIR" \
+ -jar start.jar "${SOLR_JETTY_CONFIG[@]}" \
1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
# no lsof on cygwin though