Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fixed always returning 1 if launching in background without pidpath #1883

Closed
wants to merge 1 commit into from

2 participants

@sfussenegger

Currently, the returned value depends on this line:

[ ! -z "$pidpath" ] && printf '%d' $! > "$pidpath"

rather than

exec "$JAVA" ...

which is just before. This certainly isn't intended as a successful start (script returning 0) shouldn't depend on the creation of a PID file.

@kimchy
Owner

Pushed to master and 0.19 branch, thanks!

@kimchy kimchy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 bin/elasticsearch
View
4 bin/elasticsearch
@@ -121,14 +121,16 @@ launch_service()
es_parms="$es_parms -Des.foreground=yes"
exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \
org.elasticsearch.bootstrap.ElasticSearch
+ execval=$?
else
# Startup ElasticSearch, background it, and write the pid.
exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \
org.elasticsearch.bootstrap.ElasticSearch <&- &
+ execval=$?
[ ! -z "$pidpath" ] && printf '%d' $! > "$pidpath"
fi
- return $?
+ return $execval
}
# Parse any command line options.
Something went wrong with that request. Please try again.