From d62639361fc7c563917830f3760685ee38d39d0c Mon Sep 17 00:00:00 2001 From: Robert Walter Date: Fri, 12 Apr 2024 12:25:59 +0000 Subject: [PATCH] added systemd services --- systemd/install-systemd.sh | 5 +++++ systemd/pdns-tsig-from-catalog.service | 12 ++++++++++++ systemd/pdns-tsig-from-catalog.timer | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100755 systemd/install-systemd.sh create mode 100644 systemd/pdns-tsig-from-catalog.service create mode 100644 systemd/pdns-tsig-from-catalog.timer diff --git a/systemd/install-systemd.sh b/systemd/install-systemd.sh new file mode 100755 index 0000000..964d625 --- /dev/null +++ b/systemd/install-systemd.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cp pdns-tsig-from-catalog.service pdns-tsig-from-catalog.timer /etc/systemd/system/ +systemctl daemon-reload +systemctl enable pdns-tsig-from-catalog.timer +systemctl start pdns-tsig-from-catalog.timer diff --git a/systemd/pdns-tsig-from-catalog.service b/systemd/pdns-tsig-from-catalog.service new file mode 100644 index 0000000..8a5aaae --- /dev/null +++ b/systemd/pdns-tsig-from-catalog.service @@ -0,0 +1,12 @@ +[Unit] +Description=Running pdns-tsig-from-catalog script +Wants=pdns-tsig-from-catalog.timer + +[Service] +Type=oneshot +WorkingDirectory=/opt/scripts/pdns-tsig-from-catalog/ +Environment="PATH=/opt/scripts/pdns-tsig-from-catalog/.venv/bin/" +ExecStart=python pdns-tsig-from-catalog.py + +[Install] +WantedBy=multi-user.target diff --git a/systemd/pdns-tsig-from-catalog.timer b/systemd/pdns-tsig-from-catalog.timer new file mode 100644 index 0000000..71c0ffb --- /dev/null +++ b/systemd/pdns-tsig-from-catalog.timer @@ -0,0 +1,9 @@ +[Unit] +Description=cron for pdns-tsig-from-catalog.service + +[Timer] +Unit=pdns-tsig-from-catalog.service +OnCalendar=*-*-* *:*:00 + +[Install] +WantedBy=timers.target