From: Andrew Ruthven Date: Thu, 8 Apr 2021 10:59:32 +0000 (+1200) Subject: Ensure that 50-mythtv-status has exit code 0 if no status file eixsts. X-Git-Tag: debian-sid-1.0.1-2~7 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=089616c32247d109dc735da56838a6a4bc5d12f8;p=mythtv-status.git Ensure that 50-mythtv-status has exit code 0 if no status file eixsts. I noticed that if /run/motd.mythtv-status doesn't exist then update-motd.d/50-mythtv-status exits with exit code 1 and pam_motd spits a warning. I don't really want that to happen. --- diff --git a/debian/changelog b/debian/changelog index 1e99a0d..a20752f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ mythtv-status (1.0.1-2) UNRELEASED; urgency=medium * Update systemd service file to use -f with rm (Closes: #954734). + * Patch to ensure that 50-mythtv-status has exit code 0 if no status file + exists. -- Andrew Ruthven Sun, 06 Dec 2020 22:51:12 +1300 diff --git a/debian/patches/50-mythtv-status-exit-code.patch b/debian/patches/50-mythtv-status-exit-code.patch new file mode 100644 index 0000000..35f7d41 --- /dev/null +++ b/debian/patches/50-mythtv-status-exit-code.patch @@ -0,0 +1,21 @@ +Description: Ensure that 50-mythtv-status has exit code 0 if no status file eixsts. +Author: Andrew Ruthven +Origin: upstream +Forwarded: not-needed +Applied-Upstream: 1.0.2 +Last-Update: 2021-04-08 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/update-motd.d/50-mythtv-status ++++ b/update-motd.d/50-mythtv-status +@@ -2,4 +2,9 @@ + # See: + # man mythtv-update-motd + # on how to disable this service if you don't want it to run. +-[ -f /run/motd.mythtv-status ] && cat /run/motd.mythtv-status ++ ++if [ -f /run/motd.mythtv-status ]; then ++ cat /run/motd.mythtv-status ++else ++ exit 0 ++fi diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..47d497d --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +50-mythtv-status-exit-code.patch