From 243f054b0b6b066a2e3f315ed6c406888c508ec9 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 22 Aug 2019 22:20:56 -0400 Subject: [PATCH] Remove redundant Java check from Sys V init (#45793) In the Sys V init scripts, we check for Java. This is not needed, since the same check happens in elasticsearch-env when starting up. Having this duplicate check has bitten us in the past, where we made a change to the logic in elasticsearch-env, but missed updating it here. Since there is no need for this duplicate check, we remove it from the Sys V init scripts. --- distribution/packages/src/deb/init.d/elasticsearch | 14 -------------- distribution/packages/src/rpm/init.d/elasticsearch | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/distribution/packages/src/deb/init.d/elasticsearch b/distribution/packages/src/deb/init.d/elasticsearch index 82fc52c1b50..ca48b968c91 100755 --- a/distribution/packages/src/deb/init.d/elasticsearch +++ b/distribution/packages/src/deb/init.d/elasticsearch @@ -80,22 +80,8 @@ if [ ! -x "$DAEMON" ]; then exit 1 fi -checkJava() { - if [ ! -z "${JAVA_HOME}" ]; then - JAVA="${JAVA_HOME}"/bin/java - else - JAVA="${ES_HOME}"/jdk/bin/java - fi - - if [ ! -x "$JAVA" ]; then - echo "could not find java in JAVA_HOME or bundled at ${JAVA}" - exit 1 - fi -} - case "$1" in start) - checkJava log_daemon_msg "Starting $DESC" diff --git a/distribution/packages/src/rpm/init.d/elasticsearch b/distribution/packages/src/rpm/init.d/elasticsearch index fbf9e090c1e..e93e9e99457 100644 --- a/distribution/packages/src/rpm/init.d/elasticsearch +++ b/distribution/packages/src/rpm/init.d/elasticsearch @@ -67,21 +67,7 @@ if [ ! -x "$exec" ]; then exit 1 fi -checkJava() { - if [ ! -z "${JAVA_HOME}" ]; then - JAVA="${JAVA_HOME}"/bin/java - else - JAVA="${ES_HOME}"/jdk/bin/java - fi - - if [ ! -x "$JAVA" ]; then - echo "could not find java in JAVA_HOME or bundled at ${JAVA}" - exit 1 - fi -} - start() { - checkJava [ -x $exec ] || exit 5 if [ -n "$MAX_OPEN_FILES" ]; then