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:48:01 +1300
+ -- Andrew Ruthven <andrew@etc.gen.nz> Tue, 02 Oct 2012 21:50:10 +1300
mythtv-status (0.10.2-1) unstable; urgency=low
# 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
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
exit
fi
+# Debian Wheezy+ handles the MOTD differently.
+[ -f /var/run/motd.dynamic ] && WORKFILE=/var/run/motd.dynamic
+
set -e
case "$1" in
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.
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
;;
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
;;
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