mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
parent
ebed7247e6
commit
bb46aa6188
2 changed files with 22 additions and 1 deletions
|
@ -151,7 +151,9 @@ class LogStash::Runner < Clamp::StrictCommand
|
|||
@logger.subscribe(STDOUT)
|
||||
@logger.warn("Logstash has a new settings file which defines start up time settings. This file is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \"--path.settings=/path/..\" in the command line options")
|
||||
@logger.fatal("Failed to load settings file from \"path.settings\". Aborting...", "path.settings" => LogStash::SETTINGS.get("path.settings"), "exception" => e.class, "message" => e.message)
|
||||
exit(-1)
|
||||
|
||||
# abort unless we're just looking for the help
|
||||
return(1) if (["--help", "-h"] & args).empty?
|
||||
end
|
||||
|
||||
super(*[args])
|
||||
|
|
|
@ -328,4 +328,23 @@ describe LogStash::Runner do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "path.settings" do
|
||||
subject { LogStash::Runner.new("") }
|
||||
context "if does not exist" do
|
||||
let(:args) { ["--path.settings", "/tmp/a/a/a/a", "-e", "input {} output {}"] }
|
||||
|
||||
it "should terminate logstash" do
|
||||
expect(subject.run(args)).to eq(1)
|
||||
end
|
||||
|
||||
context "but --help is passed" do
|
||||
let(:args) { ["--path.settings", "/tmp/a/a/a/a", "--help"] }
|
||||
|
||||
it "should show help" do
|
||||
expect { subject.run(args) }.to raise_error(Clamp::HelpWanted)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue