mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Refactor: revisit logstash bootstraping bits (#13791)
* Refactor: logstash boot to know what to do * Refactor: reduce LOAD_PATH - load jars directly * Refactor: unused requires in runner * Refactor: boot - require libs when to be used
This commit is contained in:
parent
f1b17be5d1
commit
4f32c4fd48
5 changed files with 9 additions and 19 deletions
|
@ -76,10 +76,7 @@ module LogStash
|
|||
end
|
||||
end
|
||||
|
||||
# when launched as a script, not require'd, (currently from bin/logstash and bin/logstash-plugin) the first
|
||||
# argument is the path of a Ruby file to require and a LogStash::Runner class is expected to be
|
||||
# defined and exposing the LogStash::Runner#main instance method which will be called with the current ARGV
|
||||
# currently lib/logstash/runner.rb and lib/pluginmanager/main.rb are called using this.
|
||||
# when launched as a script, not require'd, (currently from bin/logstash)
|
||||
if $0 == __FILE__
|
||||
bundler_options = {:without => [:build, :development]}
|
||||
## Check for dev flags - this needs to be done before the runner is invoked to set bundler options
|
||||
|
@ -89,7 +86,7 @@ if $0 == __FILE__
|
|||
LogStash::Bundler.setup!(bundler_options)
|
||||
require_relative "patches/jar_dependencies"
|
||||
|
||||
require ARGV.shift
|
||||
require 'logstash/runner'
|
||||
exit_status = LogStash::Runner.run("bin/logstash", ARGV)
|
||||
exit(exit_status || 0)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue