my bash-fu isn't that great, but AFAICT the way SOLR_OPTS is used in bin/solr breaks on any attempt i can think of to quote/escape any jvm args included in the SOLR_OPTS env variable.

Am i missing something, or is this a bug?

(see examples below)

-Hoss
http://www.lucidworks.com/


hossman@slate:~/lucene/solr [j11] [tags/releases/solr/9.3.0] $ 
SOLR_OPTS='-XX:-UseLargePages -Dfoo=bar "-Dyak=white space"'  
./solr/packaging/build/dev/bin/solr start -V -f
Using Solr root directory: /home/hossman/lucene/solr/solr/packaging/build/dev
Using Java: /opt/jdk/11/latest//bin/java
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)

Starting Solr using the following settings:
    JAVA            = /opt/jdk/11/latest//bin/java
    SOLR_SERVER_DIR = /home/hossman/lucene/solr/solr/packaging/build/dev/server
    SOLR_HOME       = 
/home/hossman/lucene/solr/solr/packaging/build/dev/server/solr
    SOLR_HOST       =
    SOLR_PORT       = 8983
    STOP_PORT       = 7983
    JAVA_MEM_OPTS   = -Xms512m -Xmx512m
    GC_TUNE         = -XX:+UseG1GC -XX:+PerfDisableSharedMem 
-XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+UseLargePages 
-XX:+AlwaysPreTouch -XX:+ExplicitGCInvokesConcurrent
    GC_LOG_OPTS     = 
-Xlog:gc*:file=/home/hossman/lucene/solr/solr/packaging/build/dev/server/logs/solr_gc.log:time,uptime:filecount=9,filesize=20M
    SOLR_TIMEZONE   = UTC
    SOLR_OPTS       = -XX:-UseLargePages -Dfoo=bar "-Dyak=white space" -Xss256k

Error: Could not find or load main class "-Dyak=white
Caused by: java.lang.ClassNotFoundException: "-Dyak=white
hossman@slate:~/lucene/solr [j11] [tags/releases/solr/9.3.0] $ 
SOLR_OPTS='-XX:-UseLargePages -Dfoo=bar -Dyak=white\ space'  
./solr/packaging/build/dev/bin/solr start -f
Error: Could not find or load main class space
Caused by: java.lang.ClassNotFoundException: space
hossman@slate:~/lucene/solr [j11] [tags/releases/solr/9.3.0] $ 
SOLR_OPTS="-XX:-UseLargePages -Dfoo=bar '-Dyak=white space'"  
./solr/packaging/build/dev/bin/solr start -f
Error: Could not find or load main class '-Dyak=white
Caused by: java.lang.ClassNotFoundException: '-Dyak=white
hossman@slate:~/lucene/solr [j11] [tags/releases/solr/9.3.0] $ 
SOLR_OPTS="-XX:-UseLargePages -Dfoo=bar -Dyak='white space'"  
./solr/packaging/build/dev/bin/solr start -f
Error: Could not find or load main class space'
Caused by: java.lang.ClassNotFoundException: space'



Reply via email to