change scripts to start the ElasticSearch main class (a wrapper around Bootstrap) just so the process name will look nicely on jps

This commit is contained in:
kimchy 2011-03-04 20:14:22 +02:00
parent c097735196
commit bc882182ab
3 changed files with 34 additions and 4 deletions

View File

@ -116,16 +116,16 @@ launch_service()
es_parms="$es_parms -Des-pidfile=$pidpath"
fi
# The es-daemon option will tell Bootstrap to close stdout/stderr,
# The es-daemon option will tell ElasticSearch to close stdout/stderr,
# but it's up to us not to background.
if [ "x$foreground" != "x" ]; then
es_parms="$es_parms -Des-foreground=yes"
exec $JAVA $JAVA_OPTS $ES_JAVA_OPTS $es_parms -cp $CLASSPATH $props \
org.elasticsearch.bootstrap.Bootstrap
org.elasticsearch.bootstrap.ElasticSearch
else
# Startup Bootstrap, background it, and write the pid.
# Startup ElasticSearch, background it, and write the pid.
exec $JAVA $JAVA_OPTS $ES_JAVA_OPTS $es_parms -cp $CLASSPATH $props \
org.elasticsearch.bootstrap.Bootstrap <&- &
org.elasticsearch.bootstrap.ElasticSearch <&- &
[ ! -z $pidpath ] && printf "%d" $! > $pidpath
fi

Binary file not shown.

View File

@ -0,0 +1,30 @@
/*
* Licensed to Elastic Search and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Elastic Search licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.bootstrap;
/**
* A wrapper around {@link Bootstrap} just so the process will look nicely on things like jps.
*/
public class ElasticSearch extends Bootstrap {
public static void main(String[] args) {
Bootstrap.main(args);
}
}