Skip to content

Commit 9aff51d

Browse files
committed
Use a systemd timer to update the blog aggregator
1 parent 30613a2 commit 9aff51d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

cookbooks/blogs/recipes/default.rb

+18-4
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,25 @@
7878
mode "0755"
7979
end
8080

81-
cron_d "blogs" do
82-
minute "*/30"
81+
systemd_service "blogs-update" do
82+
description "Update blog aggregator"
83+
exec_start "/usr/local/bin/blogs-update"
8384
user "blogs"
84-
command "/usr/local/bin/blogs-update"
85-
mailto "admins@openstreetmap.org"
85+
private_tmp true
86+
private_devices true
87+
protect_system "strict"
88+
protect_home true
89+
read_write_paths "/srv/blogs.openstreetmap.org"
90+
end
91+
92+
systemd_timer "blogs-update" do
93+
description "Update blog aggregator"
94+
on_boot_sec "15m"
95+
on_unit_inactive_sec "30m"
96+
end
97+
98+
service "blogs-update.timer" do
99+
action [:Enable, :start]
86100
end
87101

88102
template "/etc/cron.daily/blogs-backup" do

0 commit comments

Comments
 (0)