[24113] in Source-Commits
/svn/athena r23717 - trunk/debathena/config/auto-update/debian
daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Mon Apr 6 19:01:25 2009
X-Barracuda-Envelope-From: geofft@mit.edu
Date: Mon, 6 Apr 2009 19:00:58 -0400
From: Geoffrey Thomas <geofft@MIT.EDU>
Message-Id: <200904062300.n36N0wJF014483@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: geofft
Date: 2009-04-06 19:00:58 -0400 (Mon, 06 Apr 2009)
New Revision: 23717
Modified:
trunk/debathena/config/auto-update/debian/athena-auto-update
trunk/debathena/config/auto-update/debian/changelog
Log:
In auto-update:
* Don't avoid logging the output of `aptitude update` (Closes: Trac #178).
* Fix a typo that caused the logger command not to get our hostname.
Modified: trunk/debathena/config/auto-update/debian/athena-auto-update
===================================================================
--- trunk/debathena/config/auto-update/debian/athena-auto-update 2009-04-06 19:47:09 UTC (rev 23716)
+++ trunk/debathena/config/auto-update/debian/athena-auto-update 2009-04-06 23:00:58 UTC (rev 23717)
@@ -1,7 +1,7 @@
#!/bin/sh
complain() {
- logger -t "$(gethostname --fqdn)" -p user.notice "update: $*"
+ logger -t "$(hostname --fqdn)" -p user.notice "update: $*"
}
maybe_reboot() {
@@ -44,12 +44,31 @@
# Make sure nothing expects input on stdin.
exec </dev/null
-# Punt output while we figure out if there are updates to take.
-exec >/dev/null 2>&1
+# Redirect further output to a log file.
+exec >>/var/log/athena-update 2>&1
+# Write a log header now and a footer at exit.
+echo "-----"
+echo "** Beginning Athena auto-update at $(date)"
+
+finish() {
+ echo "** Ending Athena auto-update at $(date)"
+ echo "-----"
+ echo
+ rm -f $pidfile
+ exit
+}
+trap finish EXIT
+
+v() {
+ echo "** Running:" "$@"
+ "$@"
+}
+
+
# Allow hesiod cluster info to specify the debathena apt repository.
# (Will do nothing if debathena-clusterinfo isn't installed.)
-[ -x /usr/sbin/save-cluster-info ] && /usr/sbin/save-cluster-info
+[ -x /usr/sbin/save-cluster-info ] && v /usr/sbin/save-cluster-info
cinfo=/var/run/athena-clusterinfo.sh
slist=/etc/apt/sources.list.d/debathena.list
if [ -r $cinfo -a -w $slist ]; then
@@ -61,7 +80,7 @@
export DEBIAN_FRONTEND=noninteractive
# Update the aptitude cache.
-if ! aptitude --quiet --assume-yes update; then
+if ! v aptitude --quiet --assume-yes update; then
complain "aptitude update failed"
exit
fi
@@ -69,32 +88,12 @@
# Exit quietly (except for perhaps rebooting) if there are no upgrades
# to take.
pattern='^0 packages upgraded, 0 newly installed, 0 to remove'
-if aptitude --simulate --assume-yes full-upgrade | grep -q "$pattern"; then
+if v aptitude --simulate --assume-yes full-upgrade | grep -q "$pattern"; then
+ echo "Nothing to do!"
maybe_reboot
exit
fi
-# Redirect further output to a log file.
-exec >>/var/log/athena-update 2>&1
-
-# Write a log header now and a footer at exit.
-echo "-----"
-echo "** Beginning Athena auto-update at $(date)"
-
-finish() {
- echo "** Ending Athena auto-update at $(date)"
- echo "-----"
- echo
- rm -f $pidfile
- exit
-}
-trap finish EXIT
-
-v() {
- echo "** Running:" "$@"
- "$@"
-}
-
# Download packages first.
if ! v aptitude --quiet --assume-yes --download-only full-upgrade; then
complain "download failed"
Modified: trunk/debathena/config/auto-update/debian/changelog
===================================================================
--- trunk/debathena/config/auto-update/debian/changelog 2009-04-06 19:47:09 UTC (rev 23716)
+++ trunk/debathena/config/auto-update/debian/changelog 2009-04-06 23:00:58 UTC (rev 23717)
@@ -1,3 +1,10 @@
+debathena-auto-update (1.11) intrepid; urgency=low
+
+ * Don't avoid logging the output of `aptitude update` (Closes: Trac #178).
+ * Fix a typo that caused the logger command not to get our hostname.
+
+ -- Geoffrey Thomas <geofft@mit.edu> Mon, 06 Apr 2009 18:57:32 -0400
+
debathena-auto-update (1.10) unstable; urgency=low
* Update the apt-file cache when running other updates.