Skip to content

Commit 243f054

Browse files
committed
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.
1 parent de6b6fd commit 243f054

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

distribution/packages/src/deb/init.d/elasticsearch

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,8 @@ if [ ! -x "$DAEMON" ]; then
8080
exit 1
8181
fi
8282

83-
checkJava() {
84-
if [ ! -z "${JAVA_HOME}" ]; then
85-
JAVA="${JAVA_HOME}"/bin/java
86-
else
87-
JAVA="${ES_HOME}"/jdk/bin/java
88-
fi
89-
90-
if [ ! -x "$JAVA" ]; then
91-
echo "could not find java in JAVA_HOME or bundled at ${JAVA}"
92-
exit 1
93-
fi
94-
}
95-
9683
case "$1" in
9784
start)
98-
checkJava
9985

10086
log_daemon_msg "Starting $DESC"
10187

distribution/packages/src/rpm/init.d/elasticsearch

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,7 @@ if [ ! -x "$exec" ]; then
6767
exit 1
6868
fi
6969

70-
checkJava() {
71-
if [ ! -z "${JAVA_HOME}" ]; then
72-
JAVA="${JAVA_HOME}"/bin/java
73-
else
74-
JAVA="${ES_HOME}"/jdk/bin/java
75-
fi
76-
77-
if [ ! -x "$JAVA" ]; then
78-
echo "could not find java in JAVA_HOME or bundled at ${JAVA}"
79-
exit 1
80-
fi
81-
}
82-
8370
start() {
84-
checkJava
8571
[ -x $exec ] || exit 5
8672

8773
if [ -n "$MAX_OPEN_FILES" ]; then

0 commit comments

Comments
 (0)