You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2017/08/14 02:43:48 UTC

lucene-solr:master: SOLR-11084 Issue with starting script with solr.home (-s) == solr

Repository: lucene-solr
Updated Branches:
  refs/heads/master 575eead80 -> 7109820e0


SOLR-11084 Issue with starting script with solr.home (-s) == solr


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/7109820e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/7109820e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/7109820e

Branch: refs/heads/master
Commit: 7109820e01e114208d523edc9529d7b5ee783ab0
Parents: 575eead
Author: Erick Erickson <er...@apache.org>
Authored: Sun Aug 13 19:43:01 2017 -0700
Committer: Erick Erickson <er...@apache.org>
Committed: Sun Aug 13 19:43:01 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt  |  2 ++
 solr/bin/solr     | 32 +++++++++++++++++---------------
 solr/bin/solr.cmd |  4 ++--
 3 files changed, 21 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7109820e/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a7b394e..57536a5 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -98,6 +98,8 @@ Bug Fixes
 * SOLR-11228: Exclude static html files in the partials directory from authentication and authorization checks. The UI
   will open correctly with kerberos enabled (Ishan Chattopadhyaya, Varun Thacker)
 
+* SOLR-11084: Issue with starting script with solr.home (-s) == solr (Leil Ireson, Amrit Sarkar via Erick Erickson)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7109820e/solr/bin/solr
----------------------------------------------------------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index eeb6da4..c80c4fe 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -338,7 +338,8 @@ function print_usage() {
     echo "                  while reusing the same server directory set using the -d parameter. If set, the"
     echo "                  specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper."
     echo "                  This parameter is ignored when running examples (-e), as the solr.solr.home depends"
-    echo "                  on which example is run. The default value is server/solr."
+    echo "                  on which example is run. The default value is server/solr. If passed relative dir,"
+    echo "                  validation with current dir will be done, before trying default server/<dir>"
     echo ""
     echo "  -t <dir>      Sets the solr.data.home system property, where Solr will store data (index)."
     echo "                  If not set, Solr uses solr.solr.home for config and data."
@@ -481,23 +482,23 @@ function print_usage() {
     print_short_zk_usage ""
     echo "         Be sure to check the Solr logs in case of errors."
     echo ""
-    echo "             -z zkHost Optional Zookeeper connection string for all commands. If specified it"
+    echo "             -z zkHost  Optional Zookeeper connection string for all commands. If specified it"
     echo "                        overrides the 'ZK_HOST=...'' defined in solr.in.sh."
     echo ""
     echo "         upconfig uploads a configset from the local machine to Zookeeper. (Backcompat: -upconfig)"
     echo ""
     echo "         downconfig downloads a configset from Zookeeper to the local machine. (Backcompat: -downconfig)"
     echo ""
-    echo "             -n configName   Name of the configset in Zookeeper that will be the destination of"
+    echo "             -n configName    Name of the configset in Zookeeper that will be the destination of"
     echo "                             'upconfig' and the source for 'downconfig'."
     echo ""
-    echo "             -d confdir      The local directory the configuration will be uploaded from for"
+    echo "             -d confdir      The local directory the configuration will be uploaded from for"
     echo "                             'upconfig' or downloaded to for 'downconfig'. If 'confdir' is a child of"
     echo "                             ...solr/server/solr/configsets' then the configs will be copied from/to"
     echo "                             that directory. Otherwise it is interpreted as a simple local path."
     echo ""
     echo "         cp copies files or folders to/from Zookeeper or Zokeeper -> Zookeeper"
-    echo "             -r   Recursively copy <src> to <dst>. Command will fail if <src> has children and "
+    echo "             -r    Recursively copy <src> to <dst>. Command will fail if <src> has children and "
     echo "                        -r is not specified. Optional"
     echo ""
     echo "             <src>, <dest> : [file:][/]path/to/local/file or zk:/path/to/zk/node"
@@ -527,9 +528,9 @@ function print_usage() {
     echo "             Wildcards are supported when copying from local, trailing only and must be quoted."
     echo ""
     echo "         rm deletes files or folders on Zookeeper"
-    echo "             -r     Recursively delete if <path> is a directory. Command will fail if <path>"
+    echo "             -r     Recursively delete if <path> is a directory. Command will fail if <path>"
     echo "                    has children and -r is not specified. Optional"
-    echo "             <path> : [zk:]/path/to/zk/node. <path> may not be the root ('/')"
+    echo "             <path> : [zk:]/path/to/zk/node. <path> may not be the root ('/')"
     echo ""
     echo "         mv moves (renames) znodes on Zookeeper"
     echo "             <src>, <dest> : Zookeeper nodes, the 'zk:' prefix is optional."
@@ -1328,14 +1329,15 @@ if [[ "$SCRIPT_CMD" == "auth" ]]; then
     echo -e "\nSolr server directory $SOLR_SERVER_DIR not found!\n"
     exit 1
   fi
+
   if [ -z "$SOLR_HOME" ]; then
     SOLR_HOME="$SOLR_SERVER_DIR/solr"
-  else
-    if [[ $SOLR_HOME != /* ]] && [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
+  elif [[ $SOLR_HOME != /* ]]; then
+    if [[ -d "`pwd`/$SOLR_HOME" ]]; then
+      SOLR_HOME="$(pwd)/$SOLR_HOME"
+    elif [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
       SOLR_HOME="$SOLR_SERVER_DIR/$SOLR_HOME"
       SOLR_PID_DIR="$SOLR_HOME"
-    elif [[ $SOLR_HOME != /* ]] && [[ -d "`pwd`/$SOLR_HOME" ]]; then
-      SOLR_HOME="$(pwd)/$SOLR_HOME"
     fi
   fi
 
@@ -1674,12 +1676,12 @@ fi
 
 if [ -z "$SOLR_HOME" ]; then
   SOLR_HOME="$SOLR_SERVER_DIR/solr"
-else
-  if [[ $SOLR_HOME != /* ]] && [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
+elif [[ $SOLR_HOME != /* ]]; then
+  if [[ -d "`pwd`/$SOLR_HOME" ]]; then
+    SOLR_HOME="$(pwd)/$SOLR_HOME"
+  elif [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
     SOLR_HOME="$SOLR_SERVER_DIR/$SOLR_HOME"
     SOLR_PID_DIR="$SOLR_HOME"
-  elif [[ $SOLR_HOME != /* ]] && [[ -d "`pwd`/$SOLR_HOME" ]]; then
-    SOLR_HOME="$(pwd)/$SOLR_HOME"
   fi
 fi
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7109820e/solr/bin/solr.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 9a2ca9b..ce2350b 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -310,7 +310,8 @@ goto done
 @echo                   while reusing the same server directory set using the -d parameter. If set, the
 @echo                   specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper.
 @echo                   This parameter is ignored when running examples (-e), as the solr.solr.home depends
-@echo                   on which example is run. The default value is server/solr.
+@echo                   on which example is run. The default value is server/solr. If passed a relative dir
+@echo                   validation with the current dir will be done before trying the default server/<dir>
 @echo.
 @echo   -t dir        Sets the solr.data.home system property, used as root for ^<instance_dir^>/data directories.
 @echo                   If not set, Solr uses solr.solr.home for both config and data.
@@ -1426,7 +1427,6 @@ if "!CREATE_PORT!"=="" (
   goto err
 )
 
-
 if "!CREATE_CONFDIR!"=="_default" (
   echo WARNING: Using _default configset. Data driven schema functionality is enabled by default, which is
   echo          NOT RECOMMENDED for production use.