From 60b56c3c1c9d685794adde243da190cc3a1c7b59 Mon Sep 17 00:00:00 2001 From: Ulf Seltmann <useltmann@users.noreply.github.com> Date: Fri, 24 Mar 2017 16:46:13 +0100 Subject: [PATCH] added env variable to pass more options to solr binary (#939) - Resolves VUFIND-1224 --- solr.bat | 7 +++++-- solr.sh | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/solr.bat b/solr.bat index f61c08a86f2..e4a16c91749 100644 --- a/solr.bat +++ b/solr.bat @@ -22,6 +22,9 @@ rem JAVA_HOME rem Home of Java installation (not directly used by this script, but passed along to rem the standard Solr control script). rem +rem SOLR_ADDITIONAL_START_OPTIONS +rem Additional options to pass to the solr binary at startup. +rem rem SOLR_ADDITIONAL_JVM_OPTIONS rem Additional options to pass to the JVM when launching Solr. @@ -38,7 +41,7 @@ if "!%1!"=="!!" goto usage rem Set VUFIND_HOME (if not already set) if not "!%VUFIND_HOME%!"=="!!" goto vufindhomefound -rem VUFIND_HOME not set -- try to call env.bat to +rem VUFIND_HOME not set -- try to call env.bat to rem fix the problem before we give up completely if exist env.bat goto useenvbat rem If env.bat doesn't exist, the user hasn't run the installer yet. @@ -77,7 +80,7 @@ if not "!%SOLR_PORT%!"=="!!" goto solrportset set SOLR_PORT=8080 :solrportset -call %SOLR_BIN%\solr.cmd %1 -p %SOLR_PORT% -s %SOLR_HOME% -m %SOLR_HEAP% -a "-Dsolr.log=%SOLR_LOGS_DIR% %SOLR_ADDITIONAL_JVM_OPTIONS%" +call %SOLR_BIN%\solr.cmd %1 %SOLR_ADDITIONAL_START_OPTIONS% -p %SOLR_PORT% -s %SOLR_HOME% -m %SOLR_HEAP% -a "-Dsolr.log=%SOLR_LOGS_DIR% %SOLR_ADDITIONAL_JVM_OPTIONS%" goto end :usage diff --git a/solr.sh b/solr.sh index d9b33a82158..49fe26e9a28 100755 --- a/solr.sh +++ b/solr.sh @@ -23,6 +23,9 @@ # Home of Java installation (not directly used by this script, but passed along to # the standard Solr control script). # +# SOLR_ADDITIONAL_START_OPTIONS +# Additional options to pass to the solr binary at startup. +# # SOLR_ADDITIONAL_JVM_OPTIONS # Additional options to pass to the JVM when launching Solr. # @@ -67,10 +70,15 @@ then SOLR_PORT="8080" fi +if [ -z "$SOLR_ADDITIONAL_START_OPTIONS" ] +then + SOLR_ADDITIONAL_START_OPTIONS="" +fi + if [ -z "$SOLR_ADDITIONAL_JVM_OPTIONS" ] then SOLR_ADDITIONAL_JVM_OPTIONS="" fi export SOLR_LOGS_DIR=$SOLR_LOGS_DIR -"$SOLR_BIN/solr" "$1" -p "$SOLR_PORT" -s "$SOLR_HOME" -m "$SOLR_HEAP" -a "-Dsolr.log=$SOLR_LOGS_DIR $SOLR_ADDITIONAL_JVM_OPTIONS" +"$SOLR_BIN/solr" "$1" ${SOLR_ADDITIONAL_START_OPTIONS} -p "$SOLR_PORT" -s "$SOLR_HOME" -m "$SOLR_HEAP" -a "-Dsolr.log=$SOLR_LOGS_DIR $SOLR_ADDITIONAL_JVM_OPTIONS" -- GitLab