[26044] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25360 - trunk/debathena/config/auto-update/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Mon Aug 8 16:42:26 2011

Date: Mon, 8 Aug 2011 16:42:20 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201108082042.p78KgKXw020846@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2011-08-08 16:42:20 -0400 (Mon, 08 Aug 2011)
New Revision: 25360

Added:
   trunk/debathena/config/auto-update/debian/kick-auto-update.sh
Modified:
   trunk/debathena/config/auto-update/debian/changelog
   trunk/debathena/config/auto-update/debian/debathena-auto-update.install
   trunk/debathena/config/auto-update/debian/debathena-auto-update.postinst
Log:
In auto-update:
  * Ship a cron job to prevent auto-update from wedging for more than an
    hour.


Modified: trunk/debathena/config/auto-update/debian/changelog
===================================================================
--- trunk/debathena/config/auto-update/debian/changelog	2011-08-05 20:17:21 UTC (rev 25359)
+++ trunk/debathena/config/auto-update/debian/changelog	2011-08-08 20:42:20 UTC (rev 25360)
@@ -1,3 +1,10 @@
+debathena-auto-update (1.31) unstable; urgency=low
+
+  * Ship a cron job to prevent auto-update from wedging for more than an
+    hour.
+
+ -- Jonathan Reed <jdreed@mit.edu>  Mon, 08 Aug 2011 10:31:31 -0400
+
 debathena-auto-update (1.30) unstable; urgency=low
 
   * If we do stupid VGA tricks, we need to scribble over plymouth

Modified: trunk/debathena/config/auto-update/debian/debathena-auto-update.install
===================================================================
--- trunk/debathena/config/auto-update/debian/debathena-auto-update.install	2011-08-05 20:17:21 UTC (rev 25359)
+++ trunk/debathena/config/auto-update/debian/debathena-auto-update.install	2011-08-08 20:42:20 UTC (rev 25360)
@@ -3,3 +3,4 @@
 debian/athena-auto-upgrade usr/sbin
 debian/athena-auto-upgrade.8 usr/share/man/man8
 debian/mitCA.crt usr/share/debathena-auto-update
+debian/kick-auto-update.sh usr/lib/debathena-auto-update

Modified: trunk/debathena/config/auto-update/debian/debathena-auto-update.postinst
===================================================================
--- trunk/debathena/config/auto-update/debian/debathena-auto-update.postinst	2011-08-05 20:17:21 UTC (rev 25359)
+++ trunk/debathena/config/auto-update/debian/debathena-auto-update.postinst	2011-08-08 20:42:20 UTC (rev 25360)
@@ -80,9 +80,11 @@
 
 	for h in 2 4 6; do
 	    desync2cron $h 120 root /usr/sbin/athena-auto-update cron >> $UPD_CRONFILE
+	    desync2cron $(expr $h + 1) 120 root /usr/lib/debathena-auto-update/kick-auto-update.sh >> $UPD_CRONFILE
 	done
 	for h in 8 14 20; do
 	    desync2cron $h 360 root /usr/sbin/athena-auto-update cron >> $UPD_CRONFILE
+	    desync2cron $(expr $h + 1) 360 root /usr/lib/debathena-auto-update/kick-auto-update.sh >> $UPD_CRONFILE
 	done
 	echo "# Automatically generated by debathena-auto-update postinst" > $UPG_CRONFILE
 	echo "SHELL=/bin/sh" >> $UPG_CRONFILE

Added: trunk/debathena/config/auto-update/debian/kick-auto-update.sh
===================================================================
--- trunk/debathena/config/auto-update/debian/kick-auto-update.sh	                        (rev 0)
+++ trunk/debathena/config/auto-update/debian/kick-auto-update.sh	2011-08-08 20:42:20 UTC (rev 25360)
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# This is a horrible horrible hack and should be reverted once we have a
+# better solution to Trac #1020
+
+UPD_START=$(stat -c "%Y" /var/run/athena-nologin 2>/dev/null)
+[ -z "$UPD_START" ] && exit 0
+NOW=$(date +"%s")
+ELAPSED=$(expr $NOW - $UPD_START)
+# Updates do not take an hour on modern machines.
+if [ $ELAPSED -gt 3480 ]; then
+   pkill -f athena-auto-update
+   rm -f /var/run/athena-nologin
+   if [ "$(machtype -L)" != "debathena-cluster" ]; then
+       echo -e "To: root\nFrom: root\nSubject: athena-auto-update on $(hostname)\n\nathena-auto-update had become unresponsive.  It has been killed and will retry within 6 hours.  Repeated failures may merit further investigation." | sendmail root
+   fi
+fi
+exit 0


Property changes on: trunk/debathena/config/auto-update/debian/kick-auto-update.sh
___________________________________________________________________
Added: svn:executable
   + *


home help back first fref pref prev next nref lref last post