From f98cab45781c7d11b22e615199db2c62962a1bfd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 4 Sep 2015 08:45:01 +0100 Subject: [PATCH] Restart logstash-forwarder when the rails logs rotate --- cookbooks/web/templates/default/logrotate.web.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cookbooks/web/templates/default/logrotate.web.erb b/cookbooks/web/templates/default/logrotate.web.erb index 6c8b79646..085b7616c 100644 --- a/cookbooks/web/templates/default/logrotate.web.erb +++ b/cookbooks/web/templates/default/logrotate.web.erb @@ -12,6 +12,9 @@ postrotate <% if File.directory?("#{node[:web][:base_directory]}/rails") -%> /usr/bin/passenger-config restart-app <%= node[:web][:base_directory] %>/rails > /dev/null +<% if node[:recipes].include?("logstash::forwarder") -%> + /usr/bin/service logstash-forwarder restart +<% end -%> <% end -%> <% if File.directory?("#{node[:web][:base_directory]}/gpx-import") -%> /usr/bin/service gpx-import rotated -- 2.39.5