end
end
-template "/usr/local/bin/render-lowzoom" do
- source "render-lowzoom.erb"
- owner "root"
- group "root"
- mode 0755
-end
-
-template "/etc/init.d/render-lowzoom" do
- source "render-lowzoom.init.erb"
- owner "root"
- group "root"
- mode 0755
-end
-
-service "render-lowzoom" do
- action :disable
- supports :restart => true
-end
-
nodejs_package "carto"
nodejs_package "millstone"
style_directory = "/srv/tile.openstreetmap.org/styles/#{name}"
tile_directory = "/srv/tile.openstreetmap.org/tiles/#{name}"
+ template "/usr/local/bin/update-lowzoom-#{name}" do
+ source "update-lowzoom.erb"
+ owner "root"
+ group "root"
+ mode 0755
+ variables :style => name
+ end
+
+ template "/etc/init.d/update-lowzoom-#{name}" do
+ source "update-lowzoom.init.erb"
+ owner "root"
+ group "root"
+ mode 0755
+ variables :style => name
+ end
+
+ service "update-lowzoom-#{name}" do
+ action :disable
+ supports :restart => true
+ end
+
file "#{tile_directory}/planet-import-complete" do
action :create_if_missing
owner "tile"
group "tile"
subscribes :run, "git[#{style_directory}]"
notifies :restart, "service[renderd]"
- notifies :restart, "service[render-lowzoom]"
+ notifies :restart, "service[update-lowzoom-#{name}]"
end
end
+++ /dev/null
-#!/bin/bash
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-# Send output to the log
-exec > /var/log/tile/renderd-lowzoom.log 2>&1
-<% node[:tile][:styles].each do |name,details| -%>
-
-# Update low zoom tiles for style "<%= name %>"
-render_list \
- --all --force \
- --tile-dir=/srv/tile.openstreetmap.org/tiles \
- --socket=/var/run/renderd/renderd.sock \
- --num-threads=<%= ( node[:cpu][:total] - 2 ) / 4 %> \
- --map="<%= name %>" \
- --max-load=70 \
- --min-zoom=0 --max-zoom=12
-
-# Update timestamp for style "<%= name %>"
-touch \
- --reference="/srv/tile.openstreetmap.org/styles/<%= name %>/project.mml" \
- "/srv/tile.openstreetmap.org/tiles/<%= name %>/planet-import-complete"
-<% end -%>
-
-exit 0
--- /dev/null
+#!/bin/bash
+
+# DO NOT EDIT - This file is being maintained by Chef
+
+# Send output to the log
+exec > /var/log/tile/update-lowzoom-<%= @style %>.log 2>&1
+
+# Update tiles from z0 to z10 for style "<%= @style %>"
+render_list \
+ --all --force \
+ --tile-dir=/srv/tile.openstreetmap.org/tiles \
+ --socket=/var/run/renderd/renderd.sock \
+ --num-threads=<%= ( node[:cpu][:total] - 2 ) / 4 %> \
+ --map="<%= @style %>" \
+ --max-load=70 \
+ --min-zoom=0 --max-zoom=10
+
+# Update timestamp for style "<%= @style %>"
+touch \
+ --reference="/srv/tile.openstreetmap.org/styles/<%= @style %>/project.mml" \
+ "/srv/tile.openstreetmap.org/tiles/<%= @style %>/planet-import-complete"
+
+# Update tiles from z11 to z12 for style "<%= @style %>"
+render_old \
+ --tile-dir=/srv/tile.openstreetmap.org/tiles \
+ --socket=/var/run/renderd/renderd.sock \
+ --num-threads=<%= ( node[:cpu][:total] - 2 ) / 4 %> \
+ --map="<%= @style %>" \
+ --max-load=70 \
+ --min-zoom=11 --max-zoom=12
+
+exit 0
# DO NOT EDIT - This file is being maintained by Chef
start() {
- start-stop-daemon --start --chuid tile --background --make-pidfile -pidfile /var/run/render-lowzoom.pid --exec /usr/local/bin/render-lowzoom
+ start-stop-daemon --start --chuid tile --background --make-pidfile -pidfile /var/run/update-lowzoom-<%= @style %>.pid --exec /usr/local/bin/update-lowzoom-<%= @style %>
}
stop() {
- start-stop-daemon --stop --retry 300 --pidfile /var/run/render-lowzoom.pid --exec /usr/local/bin/render-lowzoom
+ start-stop-daemon --stop --retry 300 --pidfile /var/run/update-lowzoom-<%= @style %>.pid --exec /usr/local/bin/update-lowzoom-<%= @style %>
}
case "$1" in