Skip to content

Commit

Permalink
Dont write pidfile twice on startup
Browse files Browse the repository at this point in the history
There is no need to write the pidfile in the bin/elasticsearchshell script
as this happens already in the java code.

Also cleaning up the bin/elasticsearch shell script a bit (no need to return
an error code when exec is called, as this forks and exits the shell script
immediately).

Closes elastic#3529
Closes elastic#1745
  • Loading branch information
spinscale committed Aug 23, 2013
1 parent 1ac00a1 commit 2b03bc8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bin/elasticsearch
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,14 @@ 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=$?
# exec without running it in the background, makes it replace this shell, we'll never get here...
# no need to return something
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"
return $?
fi

return $execval
}

# Parse any command line options.
Expand Down

0 comments on commit 2b03bc8

Please sign in to comment.