[25869] in Source-Commits

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

/svn/athena r25272 - trunk/debathena/scripts/installer/pxe/stage1/debathena

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Jul 26 07:56:43 2011

Date: Tue, 26 Jul 2011 07:56:37 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201107261156.p6QBubjE008729@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2011-07-26 07:56:37 -0400 (Tue, 26 Jul 2011)
New Revision: 25272

Added:
   trunk/debathena/scripts/installer/pxe/stage1/debathena/sendlog
Modified:
   trunk/debathena/scripts/installer/pxe/stage1/debathena/installer.sh
Log:
Support some more logging in the installer

Modified: trunk/debathena/scripts/installer/pxe/stage1/debathena/installer.sh
===================================================================
--- trunk/debathena/scripts/installer/pxe/stage1/debathena/installer.sh	2011-07-20 22:08:01 UTC (rev 25271)
+++ trunk/debathena/scripts/installer/pxe/stage1/debathena/installer.sh	2011-07-26 11:56:37 UTC (rev 25272)
@@ -12,6 +12,14 @@
     cd /debathena
 fi
 
+debug () {
+  if [ "$test" != "test" ]; then
+    echo "$@" > /debathena/debug.log
+  else
+    echo "DEBUG: $@"
+  fi
+}
+
 pxetype=""
 
 netconfig () {
@@ -34,6 +42,7 @@
     HOSTNAME=
     echo -n "$ipprompt "
     read IPADDR
+    debug "In netconfig, user entered '$IPADDR'"
     # RFC1123 does permit hostnames to start with digits, moira doesn't
     # If you do that, suck it up and type the IP
     if echo "$IPADDR" | grep -q '[a-zA-Z]'; then
@@ -84,6 +93,8 @@
   echo "  Broadcast: $bc"
   echo "  Gateway: $GATEWAY"
 
+  debug "Calculated values: $HOSTNAME $NETMASK $GATEWAY $bc"
+
   if [ "$pxetype" != cluster ] ; then
     echo -n "Are these OK? [Y/n]: "; read response
     case $response in
@@ -135,10 +146,18 @@
   arch="amd64"
 fi
 
+# Of course the installer doesn't have `date`
+# time.mit.edu/kerberos.mit.edu is 18.7.21.144
+# This will probably break eventually
+debug "** Install begins at $(nc -w1 18.7.21.144 13)"
+
 if [ -f "/debathena/version" ]; then
   echo -n "SVN version: " && cat /debathena/version
+  debug "SVN: " "$(cat /debathena/version)"
 fi
 
+debug "Mirror $mirrorsite Type $installertype Arch $arch"
+
 echo "Welcome to Athena, Stage 1 Installer"
 echo
 
@@ -231,6 +250,16 @@
   esac
 done
 
+debug "*** Main menu complete"
+debug "Mirror: $mirrorsite Type $installertype "
+debug "Arch $arch Distro $distro Pxetype $pxetype"
+debug "eth0:"
+debug "$(ip address show eth0)"
+debug "routing:"
+debug "$(route)"
+debug "resolv.conf:"
+debug "$(cat /etc/resolv.conf)"
+
 ##############################################################################
 
 
@@ -335,10 +364,12 @@
     echo "$dkargs $kargs"
     exit 0
 fi
+debug "About to run kexec with these args: $dkargs $kargs"
 ./kexec -l linux --append="$dkargs $kargs" --initrd=initrd.gz \
 	  && sleep 3 && chvt 1 && sleep 2 && ./kexec -e
 echo "Secondary installed failed; please contact release-team@mit.edu"
 echo "with the circumstances of your install attempt.  Here's a shell for debugging:"
+echo "(You might try running this command: /debathena/sendlog )"
 # We don't want to let this fall through to an actual install of whatever
 # kernel we're using.
 while : ; do /bin/sh ; done

Added: trunk/debathena/scripts/installer/pxe/stage1/debathena/sendlog
===================================================================
--- trunk/debathena/scripts/installer/pxe/stage1/debathena/sendlog	                        (rev 0)
+++ trunk/debathena/scripts/installer/pxe/stage1/debathena/sendlog	2011-07-26 11:56:37 UTC (rev 25272)
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# This is undoubtedly a bad idea
+
+if ! [ -r /debathena/debug.log ]; then
+  echo "I can't read /debathena/debug.log and therefore can't send mail."
+  exit 0
+fi
+
+outgoing=18.7.22.104
+
+echo -n "Enter your full name: "
+read NAME
+echo -n "Enter your MIT e-mail address: "
+read ADDR
+
+echo "Sending mail..."
+msg="HELO mit.edu
+MAIL FROM: <errors@mit.edu>
+RCPT TO: <release-team@mit.edu>
+DATA
+To: release-team@mit.edu
+From: errors@mit.edu
+Subject: Stage 1 install failure log from $ADDR
+
+Contact name: $NAME
+Contact addr: $ADDR
+
+Debug log:
+$(cat /debathena/debug.log)
+.
+QUIT" 
+
+if echo "$msg" | nc -w 5 $outgoing 25; then
+  echo "Mail sent."
+else
+  echo "Couldn't send mail for some reason."
+fi
+  


Property changes on: trunk/debathena/scripts/installer/pxe/stage1/debathena/sendlog
___________________________________________________________________
Added: svn:executable
   + *


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