From: Tom Hughes Date: Tue, 4 Oct 2016 07:51:10 +0000 (+0100) Subject: Fix cgimap log rotation X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/ed5c7d0d587675ea405180db5d58ef9692dea871?hp=b6cd92c4ef72f12b0c1804bc35c93fa63d1916b6 Fix cgimap log rotation --- diff --git a/cookbooks/web/recipes/cgimap.rb b/cookbooks/web/recipes/cgimap.rb index d2966e1be..0662843f3 100644 --- a/cookbooks/web/recipes/cgimap.rb +++ b/cookbooks/web/recipes/cgimap.rb @@ -51,6 +51,7 @@ systemd_service "cgimap" do "CGIMAP_MAXDEBT" => "250" user "rails" exec_start "/usr/bin/openstreetmap-cgimap --daemon --port 8000 --instances 30#{switches}" + exec_reload "/bin/kill -HUP $MAINPID" private_tmp true private_devices true protect_system "full" diff --git a/cookbooks/web/templates/default/logrotate.web.erb b/cookbooks/web/templates/default/logrotate.web.erb index 97502eb88..8cb1da526 100644 --- a/cookbooks/web/templates/default/logrotate.web.erb +++ b/cookbooks/web/templates/default/logrotate.web.erb @@ -20,7 +20,7 @@ /etc/init.d/gpx-import rotated <% end -%> <% if File.directory?("#{node[:web][:base_directory]}/cgimap") -%> - /etc/init.d/cgimap reload + /bin/systemctl reload cgimap /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 <% end -%> endscript