From ca9ff9172d26d12c33fd0ed09494e5d9cbfe1330 Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Tue, 22 Nov 2016 16:38:04 -0500 Subject: [PATCH] add bin/ruby command to launch ruby scripts using the logstash launcher use bin/ruby instead of hardcoded vendorized jruby without :development remove symlink check per PR discussiom, will re-introduce in a followup PR --- bin/cpdump | 4 ++-- bin/ruby | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 bin/ruby diff --git a/bin/cpdump b/bin/cpdump index a49fde72c..5bbca5122 100755 --- a/bin/cpdump +++ b/bin/cpdump @@ -1,7 +1,7 @@ -#!/usr/bin/env vendor/jruby/bin/jruby +#!/usr/bin/env bin/ruby require_relative "../lib/bootstrap/environment" -LogStash::Bundler.setup!({:without => [:build]}) +LogStash::Bundler.setup!({:without => [:build, :development]}) require "logstash-core" require "logstash/environment" require "logstash/settings" diff --git a/bin/ruby b/bin/ruby new file mode 100755 index 000000000..ab7396423 --- /dev/null +++ b/bin/ruby @@ -0,0 +1,24 @@ +#!/bin/sh +# Run a ruby script using the logstash jruby launcher +# +# Usage: +# bin/ruby [arguments] +# +# Supported environment variables: +# LS_JVM_OPTS="xxx" path to file with JVM options +# LS_JAVA_OPTS="xxx" to append extra options to the defaults JAVA_OPTS provided by logstash +# JAVA_OPTS="xxx" to *completely override* the defauls set of JAVA_OPTS provided by logstash +# +# Development environment variables: +# USE_RUBY=1 to force use the local "ruby" command to launch logstash instead of using the vendored JRuby +# DEBUG=1 to output debugging information + +# use faster starting JRuby options see https://github.com/jruby/jruby/wiki/Improving-startup-time +export JRUBY_OPTS="$JRUBY_OPTS -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1" + +unset CDPATH + +. "$(cd `dirname $0`/..; pwd)/bin/logstash.lib.sh" +setup + +ruby_exec "$@"