summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'systemd')
-rw-r--r--systemd/radar-retry.service12
-rw-r--r--systemd/radar-retry.timer8
-rw-r--r--systemd/radar.service13
-rw-r--r--systemd/radar.timer11
4 files changed, 44 insertions, 0 deletions
diff --git a/systemd/radar-retry.service b/systemd/radar-retry.service
new file mode 100644
index 0000000..b878303
--- /dev/null
+++ b/systemd/radar-retry.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Retry BOM radar fetch (after failure)
+
+[Service]
+Type=oneshot
+User=st33v
+WorkingDirectory=/var/lib/radar
+ExecStart=/opt/radar/radarFetch.sh
+ExecStopPost=/bin/sh -c 'STATUS=SUCCESS; [ "$$EXIT_STATUS" != "0" ] && STATUS=FAILURE; logger -t radar-retry -p user.err "radar-retry $$STATUS exit=$$EXIT_STATUS"'
+SyslogIdentifier=radar-retry
+StandardOutput=journal
+StandardError=journal
diff --git a/systemd/radar-retry.timer b/systemd/radar-retry.timer
new file mode 100644
index 0000000..d7c8d9b
--- /dev/null
+++ b/systemd/radar-retry.timer
@@ -0,0 +1,8 @@
+[Unit]
+Description=Retry radar fetch 2 minutes after failure
+
+[Timer]
+OnActiveSec=2min
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/radar.service b/systemd/radar.service
new file mode 100644
index 0000000..8e9dd40
--- /dev/null
+++ b/systemd/radar.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Fetch BOM radar and publish loop APNG
+OnFailure=radar-retry.timer
+
+[Service]
+Type=oneshot
+User=st33v
+WorkingDirectory=/var/lib/radar
+ExecStart=/opt/radar/radarFetch.sh
+ExecStopPost=/bin/sh -c 'STATUS=SUCCESS; [ "$$EXIT_STATUS" != "0" ] && STATUS=FAILURE; logger -t radar -p user.err "radar $$STATUS exit=$$EXIT_STATUS"'
+SyslogIdentifier=radar
+StandardOutput=journal
+StandardError=journal
diff --git a/systemd/radar.timer b/systemd/radar.timer
new file mode 100644
index 0000000..c147481
--- /dev/null
+++ b/systemd/radar.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Run BOM radar fetch every 6 minutes
+
+[Timer]
+OnBootSec=2min
+OnUnitActiveSec=6min
+AccuracySec=15s
+Persistent=true
+
+[Install]
+WantedBy=timers.target