|
@@ -30,6 +30,14 @@
|
|
|
# specific language governing permissions and limitations
|
|
|
# under the License.
|
|
|
|
|
|
+env_file() {
|
|
|
+ if is_dpkg; then
|
|
|
+ echo "/etc/default/elasticsearch"
|
|
|
+ fi
|
|
|
+ if is_rpm; then
|
|
|
+ echo "/etc/sysconfig/elasticsearch"
|
|
|
+ fi
|
|
|
+}
|
|
|
|
|
|
# Export some useful paths.
|
|
|
export_elasticsearch_paths() {
|
|
@@ -40,15 +48,11 @@ export_elasticsearch_paths() {
|
|
|
export ESDATA="/var/lib/elasticsearch"
|
|
|
export ESLOG="/var/log/elasticsearch"
|
|
|
export ESPIDDIR="/var/run/elasticsearch"
|
|
|
- if is_dpkg; then
|
|
|
- export ESENVFILE="/etc/default/elasticsearch"
|
|
|
- fi
|
|
|
- if is_rpm; then
|
|
|
- export ESENVFILE="/etc/sysconfig/elasticsearch"
|
|
|
- fi
|
|
|
+ export ESENVFILE=$(env_file)
|
|
|
export PACKAGE_NAME=${PACKAGE_NAME:-"elasticsearch-oss"}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
# Install the rpm or deb package.
|
|
|
# -u upgrade rather than install. This only matters for rpm.
|
|
|
# -v the version to upgrade to. Defaults to the version under test.
|
|
@@ -94,6 +98,9 @@ install_package() {
|
|
|
else
|
|
|
skip "Only rpm or deb supported"
|
|
|
fi
|
|
|
+
|
|
|
+ # pass through java home to package
|
|
|
+ echo "JAVA_HOME=\"$JAVA_HOME\"" >> $(env_file)
|
|
|
}
|
|
|
|
|
|
# Checks that all directories & files are correctly installed after a deb or
|