From: Tom Hughes Date: Mon, 1 Oct 2018 18:26:00 +0000 (+0100) Subject: Use java 8 for logstash X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/e44c8d73601de3f478e30a0521d0d6fc52a35abf?hp=15639458644993a98702f398045ac8005e3ff023 Use java 8 for logstash --- diff --git a/cookbooks/logstash/recipes/default.rb b/cookbooks/logstash/recipes/default.rb index 620194df8..65b6035cb 100644 --- a/cookbooks/logstash/recipes/default.rb +++ b/cookbooks/logstash/recipes/default.rb @@ -22,7 +22,7 @@ include_recipe "networking" keys = data_bag_item("logstash", "keys") package %w[ - default-jre-headless + openjdk-8-jre-headless logstash ] @@ -54,6 +54,14 @@ file "/etc/logrotate.d/logstash" do mode 0o644 end +template "/etc/default/logstash" do + source "logstash.default.erb" + user "root" + group "root" + mode 0o644 + notifies :restart, "service[logstash]" +end + service "logstash" do action [:enable, :start] supports :status => true, :restart => true, :reload => true diff --git a/cookbooks/logstash/templates/default/logstash.default.erb b/cookbooks/logstash/templates/default/logstash.default.erb new file mode 100644 index 000000000..ce376aff5 --- /dev/null +++ b/cookbooks/logstash/templates/default/logstash.default.erb @@ -0,0 +1,13 @@ +# DO NOT EDIT - This file is being maintained by Chef + +JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" +LS_HOME="/usr/share/logstash" +LS_SETTINGS_DIR="/etc/logstash" +LS_PIDFILE="/var/run/logstash.pid" +LS_USER="logstash" +LS_GROUP="logstash" +LS_GC_LOG_FILE="/var/log/logstash/gc.log" +LS_OPEN_FILES="16384" +LS_NICE="19" +SERVICE_NAME="logstash" +SERVICE_DESCRIPTION="logstash"