]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/recipes/default.rb
Convert tile replication to a native systemd service
[chef.git] / cookbooks / tile / recipes / default.rb
index f8a808d737873e27be7b8c8a09b7ea20af836929..c17800156a2b91e5d57525127a4639df036bf38b 100644 (file)
@@ -457,18 +457,23 @@ template "/usr/local/bin/replicate" do
   mode 0o755
 end
 
-template "/etc/init.d/replicate" do
-  source "replicate.init.erb"
-  owner "root"
-  group "root"
-  mode 0o755
+systemd_service "replicate" do
+  description "Rendering database replication service"
+  after "postgresql.service"
+  wants "postgresql.service"
+  user "tile"
+  exec_start "/usr/local/bin/replicate"
+  private_tmp true
+  private_devices true
+  protect_system "full"
+  protect_home true
+  restart "on-failure"
 end
 
 service "replicate" do
   action [:enable, :start]
-  supports :restart => true
   subscribes :restart, "template[/usr/local/bin/replicate]"
-  subscribes :restart, "template[/etc/init.d/replicate]"
+  subscribes :restart, "systemd_service[replicate]"
 end
 
 template "/etc/logrotate.d/replicate" do