Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-6851: Set the SOLR_VAR_DIR using the SOLR_SERVICE variable, thus alleviating the need to specify the -d option when overrding the service name with -s

Timothy Potteraba932e403af
diff --git a/solr/bin/install_solr_service.sh b/solr/bin/install_solr_service.sh
index 8a6d91b9c3d..f5fab2f7740 100644
--- a/solr/bin/install_solr_service.sh
+++ b/solr/bin/install_solr_service.sh
@@ -166,24 +166,24 @@ if [ ! -d "$SOLR_EXTRACT_DIR" ]; then
exit 1
fi
+if [ -z "$SOLR_SERVICE" ]; then
+ SOLR_SERVICE=solr
+fi
+
if [ -z "$SOLR_VAR_DIR" ]; then
- SOLR_VAR_DIR=/var/solr
+ SOLR_VAR_DIR=/var/$SOLR_SERVICE
fi
if [ -z "$SOLR_USER" ]; then
SOLR_USER=solr
fi
-if [ -z "$SOLR_SERVICE" ]; then
- SOLR_SERVICE=solr
-fi
-
if [ -z "$SOLR_PORT" ]; then
SOLR_PORT=8983
fi
if [ -f "/etc/init.d/$SOLR_SERVICE" ]; then
- echo -e "\nERROR: /etc/init.d/$SOLR_SERVICE already exists! Perhaps solr is already setup as a service on this host?\n" 1>&2
+ echo -e "\nERROR: /etc/init.d/$SOLR_SERVICE already exists! Perhaps Solr is already setup as a service on this host?\n" 1>&2
exit 1
fi