]> git.openstreetmap.org Git - chef.git/commitdiff
Switch tilelog to use a systemd time and run earlier in the day
authorTom Hughes <tom@compton.nu>
Sun, 4 Jul 2021 21:21:27 +0000 (22:21 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 4 Jul 2021 21:22:53 +0000 (22:22 +0100)
Closes #431

cookbooks/tilelog/metadata.rb
cookbooks/tilelog/recipes/default.rb

index b670d0a8bbf65184616ce03a55f9449ca8217803..d5dd55bcff9cce08b69b1acc8cbda2c70bc0cfb1 100644 (file)
@@ -7,3 +7,4 @@ description      "Installs and configures tile log analysis"
 version          "1.0.0"
 supports         "ubuntu"
 depends          "python"
+depends          "systemd"
index 9596cd7fec117702882a13eb738c78e80b13fa71..9660b9d57c27b682a77cfb647174b3ce2f7c9920 100644 (file)
@@ -49,10 +49,22 @@ template "/usr/local/bin/tilelog" do
             :aws_key => passwords["aws_key"]
 end
 
-cron_d "tilelog" do
-  minute "17"
-  hour "22"
+systemd_service "tilelog" do
+  description "Tile log analysis"
   user "www-data"
-  command "/usr/local/bin/tilelog"
-  mailto "admins@openstreetmap.org"
+  exec_start "/usr/local/bin/tilelog"
+  private_tmp true
+  private_devices true
+  protect_system "strict"
+  protect_home true
+  read_write_paths tilelog_output_directory
+end
+
+systemd_timer "tilelog" do
+  description "Tile log analysis"
+  on_calendar "*-*-* 01:07:00"
+end
+
+service "tilelog.timer" do
+  action [:enable, :start]
 end