diff --git a/bin/logstash-plugin b/bin/logstash-plugin new file mode 100755 index 000000000..39b19b8df --- /dev/null +++ b/bin/logstash-plugin @@ -0,0 +1,11 @@ +#!/bin/sh + +unset CDPATH +. "$(cd `dirname $0`/..; pwd)/bin/logstash.lib.sh" +setup + +# bin/plugin is a short lived ruby script thus we can use aggressive "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 -J-noverify -X-C -Xcompile.invokedynamic=false" + +ruby_exec "${LOGSTASH_HOME}/lib/pluginmanager/main.rb" "$@" diff --git a/bin/logstash-plugin.bat b/bin/logstash-plugin.bat new file mode 100644 index 000000000..424826486 --- /dev/null +++ b/bin/logstash-plugin.bat @@ -0,0 +1,15 @@ +@echo off + +SETLOCAL + +set SCRIPT_DIR=%~dp0 +CALL "%SCRIPT_DIR%\setup.bat" + +:EXEC +if "%VENDORED_JRUBY%" == "" ( + %RUBYCMD% "%LS_HOME%\lib\pluginmanager\main.rb" %* +) else ( + %JRUBY_BIN% %jruby_opts% "%LS_HOME%\lib\pluginmanager\main.rb" %* +) + +ENDLOCAL diff --git a/bin/plugin b/bin/plugin index 8b8ef31a3..aa2bafccd 100755 --- a/bin/plugin +++ b/bin/plugin @@ -1,13 +1,6 @@ #!/bin/sh -echo "The use of bin/plugin is deprecated and will be removed in a feature release." +echo "The use of bin/plugin is deprecated and will be removed in a feature release. Please use bin/logstash-plugin." unset CDPATH -. "$(cd `dirname $0`/..; pwd)/bin/logstash.lib.sh" -setup - -# bin/plugin is a short lived ruby script thus we can use aggressive "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 -J-noverify -X-C -Xcompile.invokedynamic=false" - -ruby_exec "${LOGSTASH_HOME}/lib/pluginmanager/main.rb" "$@" +sh "$(cd `dirname $0`/..; pwd)/bin/logstash-plugin" "$@" diff --git a/bin/plugin.bat b/bin/plugin.bat index 424826486..46c8a60e0 100644 --- a/bin/plugin.bat +++ b/bin/plugin.bat @@ -2,14 +2,7 @@ SETLOCAL +ECHO "The use of bin/plugin is deprecated and will be removed in a feature release. Please use bin/logstash-plugin." + set SCRIPT_DIR=%~dp0 -CALL "%SCRIPT_DIR%\setup.bat" - -:EXEC -if "%VENDORED_JRUBY%" == "" ( - %RUBYCMD% "%LS_HOME%\lib\pluginmanager\main.rb" %* -) else ( - %JRUBY_BIN% %jruby_opts% "%LS_HOME%\lib\pluginmanager\main.rb" %* -) - -ENDLOCAL +CALL "%SCRIPT_DIR%\logstash-plugin.bat" %*