]> git.etc.gen.nz Git - mythtv-status.git/commitdiff
Ensure that 50-mythtv-status has exit code 0 if no status file eixsts.
authorAndrew Ruthven <andrew@etc.gen.nz>
Thu, 8 Apr 2021 10:59:32 +0000 (22:59 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Thu, 8 Apr 2021 11:38:36 +0000 (23:38 +1200)
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.

debian/changelog
debian/patches/50-mythtv-status-exit-code.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

index 1e99a0db149ca3203940ce52d40c23d87ac219bc..a20752f9649c9e13ec43f42849834b9c3589891e 100644 (file)
@@ -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 <andrew@etc.gen.nz>  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 (file)
index 0000000..35f7d41
--- /dev/null
@@ -0,0 +1,21 @@
+Description: Ensure that 50-mythtv-status has exit code 0 if no status file eixsts.
+Author: Andrew Ruthven <andrew@etc.gen.nz>
+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 (file)
index 0000000..47d497d
--- /dev/null
@@ -0,0 +1 @@
+50-mythtv-status-exit-code.patch