[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#691548: unblock: mythtv-status/0.10.2-2



On Wed, 2012-12-19 at 20:16 +0100, Julien Cristau wrote:
> On Sat, Oct 27, 2012 at 15:08:29 +1300, Andrew Ruthven wrote:
> > 
> > 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).
> > 
> Meh.  What business does this thing have to mess with motd...

Because it is useful? And on some hardware running it in real time while
a user is logging in is slow enough that it is a real pain, that was my
original use case.

> > 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
> 
> What's $motd?  Shouldn't this be motd (no $)?

A bug. I've just uploaded a new .deb to unstable to fix this and a minor
verbosity that could occur in some cases.

I've attached two debdiffs:
  0.10.2-1 (wheezy) -> 0.10.2-3 (new package)
  0.10.2-2 (sid)    -> 0.10.2-3 (new package)

The only other change in the debdiff is the Perl version used to
generate the man page.

Cheers!

-- 
Andrew Ruthven, Wellington, New Zealand
At home: andrew@etc.gen.nz |     linux.conf.au 2013 
                           |   Come join the party...
                           | http://lca2013.linux.org.au
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-12-20 10:31:07.000000000 +1300
@@ -1,3 +1,18 @@
+mythtv-status (0.10.2-3) unstable; urgency=low
+
+  * Fix the use of motd as a facility name, shouldn't be $motd.
+    Reported by Julian Cristau, thank you.
+  * Don't abort the init.d if we can't remove /var/run/motd.orig.
+
+ -- Andrew Ruthven <andrew@etc.gen.nz>  Thu, 20 Dec 2012 10:29:31 +1300
+
+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-12-20 10:29:04.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,8 +97,8 @@
     ;;
   stop)
     log_daemon_msg "Stopping $DESC" "$NAME"
-    [ -f /var/run/motd.orig ] && cp /var/run/motd.orig /var/run/motd
-    rm /var/run/motd.orig
+    [ -f /var/run/motd.orig ] && cp /var/run/motd.orig $WORKFILE
+    rm /var/run/motd.orig 2> /dev/null || true
     log_end_msg 0
     ;;
   status)
@@ -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 23:54:27.000000000 +1300
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
+.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.14)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -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-10-03" "perl v5.10.1" "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
diff -Nru mythtv-status-0.10.2/debian/changelog mythtv-status-0.10.2/debian/changelog
--- mythtv-status-0.10.2/debian/changelog	2012-10-02 21:50:36.000000000 +1300
+++ mythtv-status-0.10.2/debian/changelog	2012-12-20 10:31:07.000000000 +1300
@@ -1,3 +1,11 @@
+mythtv-status (0.10.2-3) unstable; urgency=low
+
+  * Fix the use of motd as a facility name, shouldn't be $motd.
+    Reported by Julian Cristau, thank you.
+  * Don't abort the init.d if we can't remove /var/run/motd.orig.
+
+ -- Andrew Ruthven <andrew@etc.gen.nz>  Thu, 20 Dec 2012 10:29:31 +1300
+
 mythtv-status (0.10.2-2) unstable; urgency=low
 
   * Handle a stale temp file more gracefully (Closes: #681684) 
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-10-02 21:47:53.000000000 +1300
+++ mythtv-status-0.10.2/debian/init.d	2012-12-20 10:29:04.000000000 +1300
@@ -21,8 +21,8 @@
 # Provides:          mythtv-status
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
-# Should-Start:      $named mythtv-backend $motd
-# Should-Stop:       $named mythtv-backend $motd
+# 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
@@ -98,7 +98,7 @@
   stop)
     log_daemon_msg "Stopping $DESC" "$NAME"
     [ -f /var/run/motd.orig ] && cp /var/run/motd.orig $WORKFILE
-    rm /var/run/motd.orig
+    rm /var/run/motd.orig 2> /dev/null || true
     log_end_msg 0
     ;;
   status)
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-10-03 14:39:16.000000000 +1300
+++ mythtv-status-0.10.2/debian/mythtv-status.1	2012-10-03 23:54:27.000000000 +1300
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
+.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.14)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -124,7 +124,7 @@
 .\" ========================================================================
 .\"
 .IX Title "MYTHTV-STATUS 1"
-.TH MYTHTV-STATUS 1 "2012-07-12" "perl v5.14.2" "User Contributed Perl Documentation"
+.TH MYTHTV-STATUS 1 "2012-10-03" "perl v5.10.1" "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

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: