From d5f826ca26f3da685d0c03f55e26eaee7ec5971e Mon Sep 17 00:00:00 2001 From: Ramez Hanna Date: Wed, 19 Jul 2017 17:04:12 +0200 Subject: [PATCH] make enabling console logging configurable if --quiet is passed in systemd the console appender breaks this is to make it configurable --- libraries/provider_service.rb | 3 ++- libraries/resource_configure.rb | 1 + templates/default/systemd_unit.erb | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/provider_service.rb b/libraries/provider_service.rb index f697cdff3..f3445185d 100644 --- a/libraries/provider_service.rb +++ b/libraries/provider_service.rb @@ -68,7 +68,8 @@ def action_configure path_home: es_conf.path_home, es_user: es_user.username, es_group: es_user.groupname, - nofile_limit: es_conf.nofile_limit + nofile_limit: es_conf.nofile_limit, + service_quiet: es_conf.service_quiet, ) only_if 'which systemctl' action :nothing diff --git a/libraries/resource_configure.rb b/libraries/resource_configure.rb index 8c9c4dfb9..6fb44803a 100644 --- a/libraries/resource_configure.rb +++ b/libraries/resource_configure.rb @@ -91,4 +91,5 @@ class ElasticsearchCookbook::ConfigureResource < Chef::Resource::LWRPBase # wipe out all default settings, your configuration items should go here. # attribute(:configuration, kind_of: Hash, default: {}.freeze) + attribute(:service_quiet, kind_of: [TrueClass, FalseClass], default: true) end diff --git a/templates/default/systemd_unit.erb b/templates/default/systemd_unit.erb index 887265075..ad73cbbbb 100644 --- a/templates/default/systemd_unit.erb +++ b/templates/default/systemd_unit.erb @@ -19,9 +19,8 @@ Group=<%= @es_group %> ExecStartPre=<%= @path_home %>/bin/elasticsearch-systemd-pre-exec -ExecStart=<%= @path_home %>/bin/elasticsearch \ +ExecStart=<%= @path_home %>/bin/elasticsearch <% if @quiet%>--quiet<% end %>\ -p ${PID_DIR}/elasticsearch.pid \ - --quiet \ -Edefault.path.logs=${LOG_DIR} \ -Edefault.path.data=${DATA_DIR} \ -Edefault.path.conf=${CONF_DIR}