+systemd_service "replicate" do
+ description "Rendering database replication service"
+ after "postgresql.service"
+ wants "postgresql.service"
+ user "tile"
+ exec_start "/usr/local/bin/replicate"
+ sandbox :enable_network => true
+ restrict_address_families "AF_UNIX"
+ read_write_paths [
+ "/store/database/nodes",
+ "/var/lib/replicate",
+ "/var/log/tile"
+ ]
+ restart "on-failure"
+end
+
+service "replicate" do
+ action [:enable, :start]
+ subscribes :restart, "template[/usr/local/bin/replicate]"
+ subscribes :restart, "systemd_service[replicate]"