]> git.openstreetmap.org Git - chef.git/blob - cookbooks/web/templates/default/logrotate.web.erb
Use passenger-config to restart passenger apps
[chef.git] / cookbooks / web / templates / default / logrotate.web.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <%= node[:web][:log_directory] %>/*.log {
4   daily
5   missingok
6   rotate 7 
7   compress
8   delaycompress
9   notifempty
10   create 0660 rails rails
11   sharedscripts
12   postrotate
13 <% if File.directory?("#{node[:web][:base_directory]}/rails") -%>
14     /usr/bin/passenger-config restart-app <%= node[:web][:base_directory] %>/rails
15 <% end -%>
16 <% if File.directory?("#{node[:web][:base_directory]}/gpx-import") -%>
17     /usr/bin/service gpx-import rotated
18 <% end -%>
19 <% if File.directory?("#{node[:web][:base_directory]}/cgimap") -%>
20     /usr/bin/service cgimap reload
21     /usr/bin/rsync <%= node[:web][:log_directory] %>/cgimap.log.2.gz ironbelly::logs/www.openstreetmap.org/cgimap-<%= node[:hostname] %>-`date -d "-2 days" +%Y-%m-%d`.gz
22 <% end -%>
23   endscript
24 }