logstash: fix lack of plist (#12144)

* logstash: fix lack of plist

Elasticsearch and Kibana both offer out-of-the-box run-as-a-service functionality, so I added it for Logstash.

* Add Alias symlink
This commit is contained in:
robertjrodger 2017-04-17 16:51:31 +02:00 committed by Mike McQuaid
parent d60e4f3746
commit 4bf7d33828
2 changed files with 32 additions and 0 deletions

1
Aliases/logstash@5.3 Symbolic link
View file

@ -0,0 +1 @@
../Formula/logstash.rb

View file

@ -33,6 +33,37 @@ class Logstash < Formula
EOS
end
plist_options :manual => "logstash"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/logstash</string>
</array>
<key>EnvironmentVariables</key>
<dict>
</dict>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/logstash.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/logstash.log</string>
</dict>
</plist>
EOS
end
test do
# workaround https://github.com/elastic/logstash/issues/6378
mkdir testpath/"config"