diff --git a/bin/logstash b/bin/logstash index fb19ca8678e..696edd49006 100755 --- a/bin/logstash +++ b/bin/logstash @@ -2,7 +2,7 @@ basedir=$(cd `dirname $0`/..; pwd) if [ -d "$basedir/.git" ] ; then - RUBY=${RUBY=jruby} + RUBY=${RUBY=$(ruby -e 'puts RUBY_ENGINE')} RUBYVER=${RUBYVER=1.9} export GEM_HOME="$basedir/vendor/bundle/${RUBY}/${RUBYVER}" export GEM_PATH= @@ -12,10 +12,10 @@ export RUBYLIB="$basedir/lib" which ruby > /dev/null 2>&1 if [ "$?" -eq 0 -a -z "$USE_JRUBY" ] ; then - ruby "$basedir/lib/logstash/runner.rb" "$@" + exec ruby "$basedir/lib/logstash/runner.rb" "$@" else # No ruby found, fetch JRuby and run. jruby="vendor/jar/jruby-complete-1.7.3.jar" [ ! -f "$jruby" ] && make build-jruby - java -jar "$jruby" "$basedir/lib/logstash/runner.rb" "$@" + exec java -jar "$jruby" "$basedir/lib/logstash/runner.rb" "$@" fi