From 3358493e6c118ca45cb9bfe7488ff40ee2a56a99 Mon Sep 17 00:00:00 2001 From: Philip Champon Date: Fri, 26 Feb 2016 12:43:16 -0500 Subject: [PATCH 1/3] replace logrotate script, for debian upstart --- metadata.rb | 3 ++- recipes/default.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 47be365f..835eda01 100644 --- a/metadata.rb +++ b/metadata.rb @@ -17,6 +17,7 @@ depends 'yum-epel' depends 'yum-erlang_solutions' depends 'dpkg_autostart' +depends 'logrotate' supports 'centos', '>= 7.0' supports 'debian', '>= 8.0' @@ -27,4 +28,4 @@ supports 'scientific' supports 'smartos' supports 'suse' -supports 'ubuntu', '>= 14.04' \ No newline at end of file +supports 'ubuntu', '>= 14.04' diff --git a/recipes/default.rb b/recipes/default.rb index a7c89395..650bda83 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -83,6 +83,18 @@ class Chef::Resource action :delete end + include_recipe 'logrotate' + + logrotate_app 'rabbitmq-server' do + path '/var/log/rabbitmq/*.log' + enable true + rotate 20 + frequency 'weekly' + options ['missingok', 'notifempty', 'delaycompress'] + sharedscripts true + postrotate '/usr/sbin/rabbitmqctl rotate_logs > /dev/null' + end + template "/etc/init/#{node['rabbitmq']['service_name']}.conf" do source 'rabbitmq.upstart.conf.erb' owner 'root' From 890c9a08251fe0d09200b7c7b3f87a74d27cb78a Mon Sep 17 00:00:00 2001 From: Philip Champon Date: Fri, 26 Feb 2016 13:08:57 -0500 Subject: [PATCH 2/3] rubocop --- recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index 650bda83..8d903c2e 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -90,7 +90,7 @@ class Chef::Resource enable true rotate 20 frequency 'weekly' - options ['missingok', 'notifempty', 'delaycompress'] + options %w[missingok notifempty delaycompress] sharedscripts true postrotate '/usr/sbin/rabbitmqctl rotate_logs > /dev/null' end From ad6e5acc8f61c0f940a895123eb30a69dbc2fcde Mon Sep 17 00:00:00 2001 From: Philip Champon Date: Fri, 26 Feb 2016 13:22:42 -0500 Subject: [PATCH 3/3] rubocop 2 --- recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index 8d903c2e..cd3c3c26 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -90,7 +90,7 @@ class Chef::Resource enable true rotate 20 frequency 'weekly' - options %w[missingok notifempty delaycompress] + options %w(missingok notifempty delaycompress) sharedscripts true postrotate '/usr/sbin/rabbitmqctl rotate_logs > /dev/null' end