From e6fe44de0890c0a07b1cabda4a7f7ef326d9889d Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 21 Aug 2019 10:09:43 -0400 Subject: [PATCH] Remove redundant Java check from Sys V init 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 82fc52c1b50f4..ca48b968c915d 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 fbf9e090c1e49..e93e9e9945735 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