From ed5c7d0d587675ea405180db5d58ef9692dea871 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 4 Oct 2016 08:51:10 +0100 Subject: [PATCH 1/1] Fix cgimap log rotation --- cookbooks/web/recipes/cgimap.rb | 1 + cookbooks/web/templates/default/logrotate.web.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- 2.43.2