Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16482: Add internal envVar for passing opts to solr/bin (#1096)

Houston Putmanfabdc8e83626
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 6eb4a5ceeeb..56ec0477e9c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -315,6 +315,8 @@ Other Changes
* SOLR-16464: Upgrade commons-text to 1.10.0 (Kevin Risden)
+* SOLR-16482: Add an internal envVar for passing options to bin/solr that will not be overriden by the user. (Houston Putman)
+
Build
---------------------
* SOLR-16204: Change Lucene dependency to Lucene 9.1.0 (Elia Porciani via Alessandro Benedetti)
diff --git a/solr/bin/solr b/solr/bin/solr
index 06ec0727d85..fd0a7d6a36f 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2181,6 +2181,11 @@ function start_solr() {
SOLR_OPTS+=($AUTHC_OPTS)
fi
+ # If there are internal options set by Solr (users should not use this variable), add them to SOLR_OPTS
+ if [ -n "$SOLR_OPTS_INTERNAL" ]; then
+ SOLR_OPTS+=($SOLR_OPTS_INTERNAL)
+ fi
+
# If a heap dump directory is specified, enable it in SOLR_OPTS
if [[ -z "${SOLR_HEAP_DUMP_DIR:-}" ]] && [[ "${SOLR_HEAP_DUMP:-}" == "true" ]]; then
SOLR_HEAP_DUMP_DIR="${SOLR_LOGS_DIR}/dumps"
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index b243f1ad6b7..17ccf4f83f0 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1338,6 +1338,7 @@ IF NOT "%REMOTE_JMX_OPTS%"=="" set "START_OPTS=%START_OPTS% %REMOTE_JMX_OPTS%"
IF NOT "%SOLR_ADDL_ARGS%"=="" set "START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%"
IF NOT "%SOLR_HOST_ARG%"=="" set "START_OPTS=%START_OPTS% %SOLR_HOST_ARG%"
IF NOT "%SOLR_OPTS%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS%"
+IF NOT "%SOLR_OPTS_INTERNAL%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS_INTERNAL%"
IF NOT "!SECURITY_MANAGER_OPTS!"=="" set "START_OPTS=%START_OPTS% !SECURITY_MANAGER_OPTS!"
IF "%SOLR_SSL_ENABLED%"=="true" (
set "SSL_PORT_PROP=-Dsolr.jetty.https.port=%SOLR_PORT%"