From: Tom Hughes Date: Tue, 2 Jul 2013 16:49:26 +0000 (+0100) Subject: Send renderd logs to a separate file X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/7609b4c7dadb461d16c7c14f18e78782a19ea13d?ds=sidebyside Send renderd logs to a separate file --- diff --git a/cookbooks/tile/metadata.rb b/cookbooks/tile/metadata.rb index 6d261cf0d..3626f3189 100644 --- a/cookbooks/tile/metadata.rb +++ b/cookbooks/tile/metadata.rb @@ -8,3 +8,4 @@ depends "apache" depends "git" depends "nodejs" depends "postgresql" +depends "tools" diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 67aeeaa11..f39c31623 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -21,6 +21,7 @@ include_recipe "apache" include_recipe "git" include_recipe "nodejs" include_recipe "postgresql" +include_recipe "tools" blocks = data_bag_item("tile", "blocks") @@ -415,6 +416,14 @@ template "/etc/cron.d/render-lowzoom" do mode 0755 end +template "/etc/rsyslog.d/20-renderd.conf" do + source "renderd.rsyslog.erb" + owner "root" + group "root" + mode 0644 + notifies :restart, "service[rsyslog]" +end + munin_plugin "mod_tile_fresh" munin_plugin "mod_tile_response" munin_plugin "mod_tile_zoom" diff --git a/cookbooks/tile/templates/default/renderd.rsyslog.erb b/cookbooks/tile/templates/default/renderd.rsyslog.erb new file mode 100644 index 000000000..59c62e6b6 --- /dev/null +++ b/cookbooks/tile/templates/default/renderd.rsyslog.erb @@ -0,0 +1,4 @@ +# DO NOT EDIT - This file is being maintained by Chef + +if $programname == 'renderd' then -/var/log/tile/renderd.log +& ~ diff --git a/cookbooks/tools/recipes/default.rb b/cookbooks/tools/recipes/default.rb index c5e85a6ab..45fc074a4 100644 --- a/cookbooks/tools/recipes/default.rb +++ b/cookbooks/tools/recipes/default.rb @@ -37,3 +37,10 @@ package "iotop" if node[:lsb][:release].to_f <= 11.04 package "lslk" end + +package "rsyslog" + +service "rsyslog" do + action [ :enable, :start ] + supports :status => true, :restart => true, :reload => true +end