fixed always returning 1 if launching in background without pidpath

This commit is contained in:
Stefan Fussenegger 2012-04-24 11:10:54 +03:00 committed by Shay Banon
parent 22b2aa69d1
commit a96391224a
1 changed files with 3 additions and 1 deletions

View File

@ -121,14 +121,16 @@ launch_service()
es_parms="$es_parms -Des.foreground=yes" 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 \ exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \
org.elasticsearch.bootstrap.ElasticSearch org.elasticsearch.bootstrap.ElasticSearch
execval=$?
else else
# Startup ElasticSearch, background it, and write the pid. # 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 \ exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \
org.elasticsearch.bootstrap.ElasticSearch <&- & org.elasticsearch.bootstrap.ElasticSearch <&- &
execval=$?
[ ! -z "$pidpath" ] && printf '%d' $! > "$pidpath" [ ! -z "$pidpath" ] && printf '%d' $! > "$pidpath"
fi fi
return $? return $execval
} }
# Parse any command line options. # Parse any command line options.