Bug#691548: unblock: mythtv-status/0.10.2-2
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package mythtv-status
The version in unstable removes some extraneous debugging from the init.d
(bug #681684) and adds support for the new dynamic motd logic in Wheezy
(bug #688034 should probably be flagged as Important).
diff -Nru mythtv-status-0.10.2/debian/changelog mythtv-status-0.10.2/debian/changelog
--- mythtv-status-0.10.2/debian/changelog 2012-07-07 16:34:36.000000000 +1200
+++ mythtv-status-0.10.2/debian/changelog 2012-10-02 21:50:36.000000000 +1300
@@ -1,3 +1,10 @@
+mythtv-status (0.10.2-2) unstable; urgency=low
+
+ * Handle a stale temp file more gracefully (Closes: #681684)
+ * base-files 6.11 in Wheezy uses /var/run/motd.dynamic (Closes: #688034)
+
+ -- Andrew Ruthven <andrew@etc.gen.nz> Tue, 02 Oct 2012 21:50:10 +1300
+
mythtv-status (0.10.2-1) unstable; urgency=low
* New upstream release. (Closes: #680358)
diff -Nru mythtv-status-0.10.2/debian/init.d mythtv-status-0.10.2/debian/init.d
--- mythtv-status-0.10.2/debian/init.d 2012-03-22 23:33:58.000000000 +1300
+++ mythtv-status-0.10.2/debian/init.d 2012-10-02 21:47:53.000000000 +1300
@@ -21,8 +21,8 @@
# Provides: mythtv-status
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
-# Should-Start: $named mythtv-backend
-# Should-Stop: $named mythtv-backend
+# Should-Start: $named mythtv-backend $motd
+# Should-Stop: $named mythtv-backend $motd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Update the MOTD with the MythTV status
@@ -35,6 +35,7 @@
NAME=mythtv-status # Introduce the short server's name here
DESC="MythTV Status" # Introduce a short description here
TEMPFILE=/var/run/motd.mythtv-status
+WORKFILE=/var/run/motd
test -x $DAEMON || exit 0
@@ -53,6 +54,9 @@
exit
fi
+# Debian Wheezy+ handles the MOTD differently.
+[ -f /var/run/motd.dynamic ] && WORKFILE=/var/run/motd.dynamic
+
set -e
case "$1" in
@@ -60,14 +64,18 @@
log_daemon_msg "Updating $DESC" "$NAME"
# Just incase someone has removed their motd file.
- [ -f /var/run/motd ] || touch /var/run/motd
- [ -f /var/run/motd.orig ] || cp /var/run/motd /var/run/motd.orig
+ [ -f $WORKFILE ] || touch $WORKFILE
+ [ -f /var/run/motd.orig ] || cp $WORKFILE /var/run/motd.orig
+ # If the tempfile is less than 15 minutes old, object, otherwise
+ # we'll assume that something went wrong and remove it.
if [ -f $TEMPFILE ]; then
- echo "Hey, $TEMPFILE already exists" 1>&2
- ls -l /var/run/motd* 1>&2
- ps -ef | grep mythtv-status 1>&2
- cat /var/run/motd.new 1>&2
+ AGE=$(stat -c "%Z" $TEMPFILE);
+ if expr $AGE \> $(date +'%s') - 900
+ then
+ log_warning_msg "I think another $NAME is running."
+ exit 1
+ fi
fi
cp /var/run/motd.orig $TEMPFILE
@@ -77,12 +85,10 @@
$DAEMON $ARGS -h $HOST >> $TEMPFILE || ret=$?
if [ $ret -eq 0 -o $ret -eq 1 ]; then
if [ ! -f $TEMPFILE ]; then
- # My file has gone away. WTF?! Spit out some debugging.
- echo "Odd, $TEMPFILE has gone away. Start: $date, End: $(date)" 1>&2
- ls -l /var/run/motd* 1>&2
- ps -ef | grep mythtv-status 1>&2
+ log_failure_msg "My temporary file has gone away, failed."
+ exit 1
else
- mv $TEMPFILE /var/run/motd
+ mv $TEMPFILE $WORKFILE
fi
log_end_msg 0
else
@@ -91,7 +97,7 @@
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
- [ -f /var/run/motd.orig ] && cp /var/run/motd.orig /var/run/motd
+ [ -f /var/run/motd.orig ] && cp /var/run/motd.orig $WORKFILE
rm /var/run/motd.orig
log_end_msg 0
;;
@@ -100,11 +106,11 @@
log_failure_msg "$NAME is not running"
exit 1
fi
- if [ ! -f /var/run/motd ]; then
- log_failure_msg "$NAME is not running (no motd file!)"
+ if [ ! -f $WORKFILE ]; then
+ log_failure_msg "$NAME is not running (no motd file)!"
exit 1
fi
- if [ $(date -d "15 minutes ago" +"%s") -gt $(stat -c "%Y" /var/run/motd) ]
+ if [ $(date -d "15 minutes ago" +"%s") -gt $(stat -c "%Y" $WORKFILE) ]
then
log_failure_msg "$NAME is not running (motd file is stale)"
exit 1
diff -Nru mythtv-status-0.10.2/debian/mythtv-status.1 mythtv-status-0.10.2/debian/mythtv-status.1
--- mythtv-status-0.10.2/debian/mythtv-status.1 2012-07-07 22:39:39.000000000 +1200
+++ mythtv-status-0.10.2/debian/mythtv-status.1 2012-10-03 14:39:16.000000000 +1300
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "MYTHTV-STATUS 1"
-.TH MYTHTV-STATUS 1 "2012-07-07" "perl v5.14.2" "User Contributed Perl Documentation"
+.TH MYTHTV-STATUS 1 "2012-07-12" "perl v5.14.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
unblock mythtv-status/0.10.2-2
-- System Information:
Debian Release: wheezy/sid
APT prefers common
APT policy: (500, 'common'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 3.2.23-vs2.3.2.12-beng (SMP w/2 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Reply to: