This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new fabdc8e8362 SOLR-16482: Add internal envVar for passing opts to 
solr/bin (#1096)
fabdc8e8362 is described below

commit fabdc8e836264f309c0224ef190abe13bb749641
Author: Houston Putman <[email protected]>
AuthorDate: Thu Oct 20 11:58:47 2022 -0400

    SOLR-16482: Add internal envVar for passing opts to solr/bin (#1096)
    
    The name of the envVar is SOLR_OPTS_INTERNAL
---
 solr/CHANGES.txt  | 2 ++
 solr/bin/solr     | 5 +++++
 solr/bin/solr.cmd | 1 +
 3 files changed, 8 insertions(+)

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%"

Reply via email to