]> git.ipfire.org Git - dbl.git/commitdiff
systemd: Add timers to send notifications
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Jan 2026 17:14:20 +0000 (17:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Jan 2026 17:14:20 +0000 (17:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/systemd/.gitignore [new file with mode: 0644]
src/systemd/dnsbl-notify.service.in [new file with mode: 0644]
src/systemd/dnsbl-notify.timer [new file with mode: 0644]

index 20bef28f2b5f3619597b18433ac9453417732c8b..f125e1c0180f6d92aefb064ed835718963b2b7a4 100644 (file)
@@ -76,7 +76,17 @@ dist_pkgpython_api_PYTHON = \
 pkgpython_apidir = $(pkgpythondir)/api
 
 dist_systemdsystemunit_DATA = \
-       src/systemd/dnsbl-api.service
+       src/systemd/dnsbl-api.service \
+       src/systemd/dnsbl-notify.timer
+
+systemdsystemunit_DATA = \
+       src/systemd/dnsbl-notify.service
+
+EXTRA_DIST += \
+       src/systemd/dnsbl-notify.service.in
+
+CLEANFILES += \
+       src/systemd/dnsbl-notify.service
 
 # ------------------------------------------------------------------------------
 
diff --git a/src/systemd/.gitignore b/src/systemd/.gitignore
new file mode 100644 (file)
index 0000000..0d1a9c7
--- /dev/null
@@ -0,0 +1 @@
+/dnsbl-notify.service
diff --git a/src/systemd/dnsbl-notify.service.in b/src/systemd/dnsbl-notify.service.in
new file mode 100644 (file)
index 0000000..4aea08b
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=IPFire DNSBL Notification
+
+[Service]
+Type=oneshot
+ExecStart=@bindir@/dnsbl --quiet notify
+User=nobody
+
+[Install]
+WantedBy=multi-user.target
diff --git a/src/systemd/dnsbl-notify.timer b/src/systemd/dnsbl-notify.timer
new file mode 100644 (file)
index 0000000..99df620
--- /dev/null
@@ -0,0 +1,17 @@
+[Unit]
+Description=IPFire DNSBL Notification Timer
+
+[Timer]
+# Run at 9:00 AM
+OnCalendar=*-*-* 09:00:00
+# Run at 2:00 PM
+OnCalendar=*-*-* 14:00:00
+
+# Ensure we don't miss runs if system was off
+Persistent=true
+
+# Add small random delay to avoid exact-time system load
+RandomizedDelaySec=300
+
+[Install]
+WantedBy=timers.target