]> git.openstreetmap.org Git - chef.git/commitdiff
Run planetdump as a systemd service with a 64Gb memory limit
authorTom Hughes <tom@compton.nu>
Fri, 17 Jul 2020 16:17:16 +0000 (17:17 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 17 Jul 2020 16:20:35 +0000 (17:20 +0100)
cookbooks/planet/metadata.rb
cookbooks/planet/recipes/dump.rb

index 425fe95f537a100d5eef2e5c6874c5ad61e89058..99c6c4e1cbde4d399d1e9007f6b05c290d3b9220 100644 (file)
@@ -12,3 +12,4 @@ depends           "git"
 depends           "incron"
 depends           "munin"
 depends           "osmosis"
+depends           "systemd"
index f7274caa7b2495b1d692182795d8e4aff30a11f4..d873a903652b3999bc11920b1bb6e8a0c7b5a329 100644 (file)
 #
 
 node.default[:incron][:planetdump] = {
-  :user => "www-data",
+  :user => "root",
   :path => "/store/backup",
   :events => %w[IN_CREATE IN_MOVED_TO],
-  :command => "/usr/local/bin/planetdump $#"
+  :command => "/usr/bin/systemctl start planetdump@$#"
 }
 
 include_recipe "git"
@@ -107,6 +107,19 @@ end
   end
 end
 
+systemd_service "planetdump@" do
+  description "Planet dump for %i"
+  user "www-data"
+  exec_start "/usr/local/bin/planetdump %i"
+  memory_max "64G"
+  private_tmp true
+  private_devices true
+  private_network true
+  protect_system "full"
+  protect_home true
+  no_new_privileges true
+end
+
 template "/etc/cron.d/planet-dump-mirror" do
   source "planet-dump-mirror-cron.erb"
   owner "root"