From fb9b414e2c3e1b735081016878e14060cb13399c Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sun, 16 Jul 2023 14:58:26 +1200 Subject: [PATCH] Include systemd service and timer files --- ChangeLog | 3 +++ Makefile | 6 ++++++ {debian => bin}/health-check | 0 debian/cron.d | 2 +- debian/cron.daily | 5 +++++ debian/install | 5 ----- debian/patches/makefile-man-path.patch | 6 +++--- {debian => systemd}/mythtv-status.service | 0 {debian => systemd}/mythtv-status_health-check.service | 2 +- {debian => systemd}/mythtv-status_health-check.timer | 0 {debian => systemd}/mythtv-status_update-motd.service | 2 +- {debian => systemd}/mythtv-status_update-motd.timer | 2 +- 12 files changed, 21 insertions(+), 12 deletions(-) rename {debian => bin}/health-check (100%) rename {debian => systemd}/mythtv-status.service (100%) rename {debian => systemd}/mythtv-status_health-check.service (70%) rename {debian => systemd}/mythtv-status_health-check.timer (100%) rename {debian => systemd}/mythtv-status_update-motd.service (72%) rename {debian => systemd}/mythtv-status_update-motd.timer (76%) diff --git a/ChangeLog b/ChangeLog index 71b35b6..0589e2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,9 @@ Actually install the mythtv-update-motd man page! + Provide systemd service and timer files in tarball, hopefully useful as a + starting point for distros other than Debian. + 2001-02-14 Andrew Ruthven Release version 1.0.2. diff --git a/Makefile b/Makefile index f74eddc..e16d8f7 100755 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ #!/usr/bin/make -f BINDIR=$(DESTDIR)/usr/bin +LIBEXECDIR=$(DESTDIR)/usr/libexec/mythtv-status MANDIR=$(DESTDIR)/usr/man +SYSTEMDDIR=$(DESTDIR)/lib/systemd/system package=mythtv-status releases=sid @@ -69,15 +71,19 @@ upload: $(RELEASE_FILES) install: install -d $(BINDIR) + install -d $(LIBEXECDIR) install -d $(MANDIR)/man1 install -d $(MANDIR)/man8 + install -d $(SYSTEMDDIR) install -m 775 bin/mythtv-status $(BINDIR) install -m 775 bin/mythtv_recording_now $(BINDIR) install -m 775 bin/mythtv_recording_soon $(BINDIR) + install -m 775 bin/health-check $(LIBEXECDIR) pod2man bin/mythtv-status > $(MANDIR)/man1/mythtv-status.1 install -m 644 man/mythtv-update-motd.8 $(MANDIR)/man8 install -m 644 man/mythtv_recording_now.1 $(MANDIR)/man1 install -m 644 man/mythtv_recording_soon.1 $(MANDIR)/man1 + install -m 644 systemd/* $(SYSTEMDDIR) test: PERL_DL_NONLAZY=1 perl "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE))" $(TEST_FILES) diff --git a/debian/health-check b/bin/health-check similarity index 100% rename from debian/health-check rename to bin/health-check diff --git a/debian/cron.d b/debian/cron.d index 0dcad6a..9370fa4 100644 --- a/debian/cron.d +++ b/debian/cron.d @@ -1,4 +1,4 @@ # # Regular cron jobs for the mythtv-status package # -*/10 * * * * root [ -x /usr/sbin/mythtv-update-motd ] && /usr/sbin/mythtv-update-motd > /dev/null +*/10 * * * * root [ -x /usr/sbin/mythtv-update-motd ] && [ ! -d /run/systemd/system ] && /usr/sbin/mythtv-update-motd > /dev/null diff --git a/debian/cron.daily b/debian/cron.daily index 34cc283..a0302c8 100644 --- a/debian/cron.daily +++ b/debian/cron.daily @@ -1,5 +1,10 @@ #!/bin/sh +# Skip in favour of systemd timer +[ -d /run/systemd/system ] && exit 0 + +# Common script shared with the systemd service to perform a health +# check of the MythTV system.. [ -x /usr/lib/mythtv-status/health-check ] \ && /usr/local/mythtv-status/health-check diff --git a/debian/install b/debian/install index 741d319..b70cead 100644 --- a/debian/install +++ b/debian/install @@ -1,9 +1,4 @@ bin/mythtv-update-motd /usr/sbin -debian/health-check usr/libexec/mythtv-status debian/lintian/overrides/mythtv-status usr/share/lintian/overrides -debian/mythtv-status_health-check.service lib/systemd/system -debian/mythtv-status_health-check.timer lib/systemd/system -debian/mythtv-status_update-motd.service lib/systemd/system -debian/mythtv-status_update-motd.timer lib/systemd/system molly-guard/40-mythtv-recording-soon etc/molly-guard/run.d update-motd.d/50-mythtv-status etc/update-motd.d diff --git a/debian/patches/makefile-man-path.patch b/debian/patches/makefile-man-path.patch index a7891a8..4055a49 100644 --- a/debian/patches/makefile-man-path.patch +++ b/debian/patches/makefile-man-path.patch @@ -6,12 +6,12 @@ Last-Update: 2023-07-16 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/Makefile +++ b/Makefile -@@ -1,7 +1,7 @@ - #!/usr/bin/make -f +@@ -2,7 +2,7 @@ BINDIR=$(DESTDIR)/usr/bin + LIBEXECDIR=$(DESTDIR)/usr/libexec/mythtv-status -MANDIR=$(DESTDIR)/usr/man +MANDIR=$(DESTDIR)/usr/share/man + SYSTEMDDIR=$(DESTDIR)/lib/systemd/system package=mythtv-status - releases=sid diff --git a/debian/mythtv-status.service b/systemd/mythtv-status.service similarity index 100% rename from debian/mythtv-status.service rename to systemd/mythtv-status.service diff --git a/debian/mythtv-status_health-check.service b/systemd/mythtv-status_health-check.service similarity index 70% rename from debian/mythtv-status_health-check.service rename to systemd/mythtv-status_health-check.service index 6948fa8..fbd0a0a 100644 --- a/debian/mythtv-status_health-check.service +++ b/systemd/mythtv-status_health-check.service @@ -4,4 +4,4 @@ Documentation=man:mythtv-status(1) [Service] Type=oneshot -ExecStart=/usr/lib/mythtv-status/health-check +ExecStart=/usr/libexec/mythtv-status/health-check diff --git a/debian/mythtv-status_health-check.timer b/systemd/mythtv-status_health-check.timer similarity index 100% rename from debian/mythtv-status_health-check.timer rename to systemd/mythtv-status_health-check.timer diff --git a/debian/mythtv-status_update-motd.service b/systemd/mythtv-status_update-motd.service similarity index 72% rename from debian/mythtv-status_update-motd.service rename to systemd/mythtv-status_update-motd.service index c044662..8ad6dfb 100644 --- a/debian/mythtv-status_update-motd.service +++ b/systemd/mythtv-status_update-motd.service @@ -1,6 +1,6 @@ [Unit] Description=mythtv-status MOTD update -Documentation=man:mythtv-update-motd(1) +Documentation=man:mythtv-update-motd(8) [Service] Type=oneshot diff --git a/debian/mythtv-status_update-motd.timer b/systemd/mythtv-status_update-motd.timer similarity index 76% rename from debian/mythtv-status_update-motd.timer rename to systemd/mythtv-status_update-motd.timer index 09dfcd9..cd1cea8 100644 --- a/debian/mythtv-status_update-motd.timer +++ b/systemd/mythtv-status_update-motd.timer @@ -1,6 +1,6 @@ [Unit] Description=mythtv-status MOTD update -Documentation=man:mythtv-update-motd(1) +Documentation=man:mythtv-update-motd(8) [Timer] OnCalendar=*-*-* *:00,15,30,45 -- 2.30.2