]> git.openstreetmap.org Git - chef.git/commitdiff
Switch planet mirroring to use a systemd timer
authorTom Hughes <tom@compton.nu>
Sun, 27 Nov 2022 18:50:02 +0000 (18:50 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 27 Nov 2022 19:02:16 +0000 (19:02 +0000)
cookbooks/planet/recipes/dump.rb

index d565750119e8c6d2b24fed089e499d327b671bb4..30d39359cc902a2afe21126bdca01ed637b0d19e 100644 (file)
@@ -125,9 +125,20 @@ systemd_service "planetdump@" do
   ]
 end
 
-cron_d "planet-dump-mirror" do
-  minute "*/10"
+systemd_service "planet-dump-mirror" do
+  description "Update planet dump mirrors"
+  exec_start "/usr/local/bin/planet-mirror-redirect-update"
   user "www-data"
-  command "/usr/local/bin/planet-mirror-redirect-update"
-  mailto "horntail-www-data-cron@firefishy.com"
+  sandbox :enable_network => true
+  read_write_paths "/store/planet/.htaccess"
+end
+
+systemd_timer "planet-dump-mirror" do
+  description "Update planet dump mirrors"
+  on_boot_sec "10min"
+  on_unit_inactive_sec "10min"
+end
+
+service "planet-dump-mirror.timer" do
+  action [:enable, :start]
 end