Skip to content

Commit

Permalink
Merge pull request #349 from Adaptly/pc-fix-debian-upstart-logrotate
Browse files Browse the repository at this point in the history
replace logrotate script, for debian upstart
  • Loading branch information
JJ Asghar authored May 15, 2017
2 parents 0e031f4 + ad6e5ac commit 4c744d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
depends 'yum-epel'
depends 'yum-erlang_solutions'
depends 'dpkg_autostart'
depends 'logrotate'

supports 'centos', '>= 7.0'
supports 'debian', '>= 8.0'
Expand Down
12 changes: 12 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,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 %w(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'
Expand Down

0 comments on commit 4c744d1

Please sign in to comment.