From 48291fc94662b937594a3b7f3838b5844a186446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Stensg=C3=A5rd?= Date: Tue, 22 Jul 2025 23:22:32 +0200 Subject: systemd: add services and timer --- Makefile | 4 ++++ systemd/opplysning-forfrisk.service | 6 ++++++ systemd/opplysning-forfrisk.timer | 9 +++++++++ systemd/opplysning-vis.service | 9 +++++++++ 4 files changed, 28 insertions(+) create mode 100644 systemd/opplysning-forfrisk.service create mode 100644 systemd/opplysning-forfrisk.timer create mode 100644 systemd/opplysning-vis.service diff --git a/Makefile b/Makefile index ac4e349..e0f9f4f 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,10 @@ install: all cp -f font/BellCentennialStd-Address.ttf /opt/opplysning/font/ cp -f font/adventpro-bold.ttf /opt/opplysning/font/ mkdir -p /opt/opplysning/var + cp -f systemd/opplysning-forfrisk.service /lib/systemd/system + cp -f systemd/opplysning-forfrisk.timer /lib/systemd/system + cp -f systemd/opplysning-vis.service /lib/systemd/system + systemctl daemon-reload .PHONY: all check clean install diff --git a/systemd/opplysning-forfrisk.service b/systemd/opplysning-forfrisk.service new file mode 100644 index 0000000..e3542f8 --- /dev/null +++ b/systemd/opplysning-forfrisk.service @@ -0,0 +1,6 @@ +[Unit] +Description=Forfrisk opplysninger + +[Service] +Type=simple +ExecStart=/opt/opplysning/bin/opplysning-forfrisk diff --git a/systemd/opplysning-forfrisk.timer b/systemd/opplysning-forfrisk.timer new file mode 100644 index 0000000..ba4000e --- /dev/null +++ b/systemd/opplysning-forfrisk.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Forfrisk opplysninger ved oppstart, og hvert femte minutt + +[Timer] +OnBootSec=1min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target diff --git a/systemd/opplysning-vis.service b/systemd/opplysning-vis.service new file mode 100644 index 0000000..9b25f68 --- /dev/null +++ b/systemd/opplysning-vis.service @@ -0,0 +1,9 @@ +[Unit] +Description=Vis fram opplysninger + +[Service] +Type=simple +ExecStart=/opt/opplysning/bin/opplysning-vis + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3