[D-community-commits] r314 - in trunk/fai-config-dir: class files/usr/local/sbin/softupdate hooks

holger at alioth.debian.org holger at alioth.debian.org
Thu Jul 24 16:52:33 UTC 2008


Author: holger
Date: 2008-07-24 16:52:32 +0000 (Thu, 24 Jul 2008)
New Revision: 314

Modified:
   trunk/fai-config-dir/class/DEFAULT.var
   trunk/fai-config-dir/files/usr/local/sbin/softupdate/DEFAULT
   trunk/fai-config-dir/hooks/savelog.LAST.source
Log:
bugfixes, no softpudate detects errors correctlsy again

Modified: trunk/fai-config-dir/class/DEFAULT.var
===================================================================
--- trunk/fai-config-dir/class/DEFAULT.var	2008-07-24 11:11:00 UTC (rev 313)
+++ trunk/fai-config-dir/class/DEFAULT.var	2008-07-24 16:52:32 UTC (rev 314)
@@ -1,2 +1,6 @@
 # default timezone
 TIMEZONE=Etc/UTC
+
+# for hooks/savelog.LAST
+hosterrorpatterns="XXXXX"
+hostignorepatterns="XXXXX"

Modified: trunk/fai-config-dir/files/usr/local/sbin/softupdate/DEFAULT
===================================================================
--- trunk/fai-config-dir/files/usr/local/sbin/softupdate/DEFAULT	2008-07-24 11:11:00 UTC (rev 313)
+++ trunk/fai-config-dir/files/usr/local/sbin/softupdate/DEFAULT	2008-07-24 16:52:32 UTC (rev 314)
@@ -1,7 +1,7 @@
 #/bin/sh
 
 #
-#        (c) 2006 Holger Levsen         holger at layer-acht.org
+#        (c) 2008 Holger Levsen         holger at layer-acht.org
 #        GPL2 licenced
 #
 #
@@ -15,5 +15,12 @@
 fai -N softupdate
 echo
 
-[ -f /var/log/fai/localhost/last/error.log ] && cat /var/log/fai/localhost/last/error.log
+HOSTNAME=`hostname`
 
+[ -f /var/log/fai/$HOSTNAME/last/error.log ] && cat /var/log/fai/$HOSTNAME/last/error.log
+
+REVISION=`cd /var/lib/fai/config/ && svn up`
+SUBJECT="`hostname -s` upgraded to $REVISION"
+cat /var/log/fai/$HOSTNAME/last/error.log 2>/dev/null| mail -s "$SUBJECT" root
+
+[ -f /var/log/fai/$HOSTNAME/last/error.log ] && exit 1

Modified: trunk/fai-config-dir/hooks/savelog.LAST.source
===================================================================
--- trunk/fai-config-dir/hooks/savelog.LAST.source	2008-07-24 11:11:00 UTC (rev 313)
+++ trunk/fai-config-dir/hooks/savelog.LAST.source	2008-07-24 16:52:32 UTC (rev 314)
@@ -32,6 +32,7 @@
 [a-z]\+\.log:E: 
 No candidate version found
 segfault
+Couldn't find any package whose name or description matched
 cannot create"
 
 globalignorepatterns="[a-z]\+\.log:# 
@@ -53,8 +54,8 @@
 libclass-errorhandler-perl
 zope-ploneerrorreporting
 libroxen-errormessage
-libroxen-errormessage
 liberror-perl
+libgpg-error-dev
 libgpg-error0
 ^fstab.\+errors=remount
 [RT]X packets:
@@ -110,22 +111,30 @@
 Warning: The partition table looks like it was made
 task_error=0
 ^info: Trying to set 
-cdrom: open failed.
-hosterrorpatterns"
+warning: /usr/lib/X11/fonts
+can't read /etc/udev/rules.d/z25_persistent-net.rules
+/cow': No such file or directory
+Dummy start-stop-daemon called
+cdrom: open failed."
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 # Here you can define your own patterns. Put one pattern in a line,
 # do not create empty lines.
 myerrorpatterns="XXXXX"
-myignorepatterns="hdd: IRQ probe failed (0xfcfdfef8)
-hdc: IRQ probe failed (0xfcfdfef8)"
+myignorepatterns="3w-9xxx:.*
+awk: cannot open /tmp/fai.*debconf.data.*
+awk: cmd. line:1:.*
+grep: /proc/partitions: No such file or directory
+variables.log:task_error=0
+fail2ban is already the newest version.
+fail2ban ist schon die neueste Version."
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 # The main routine
 errorpatterns="$globalerrorpatterns
-$myerrorpatterns
-$hosterrorpatterns"
+$hosterrorpatterns
+$myerrorpatterns"
 ignorepatterns="$globalignorepatterns
-$myignorepatterns
-$hostignorepatterns"
+$hostignorepatterns
+$myignorepatterns"
 
 cd $LOGDIR || exit 3
 if [ -s $errfile ]; then
@@ -134,10 +143,32 @@
 fi
 
 grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
+if [ "$verbose" ]; then
+    egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
+    mv $LOGDIR/tempfile $errfile
+fi
 
 if [ -s $errfile ]; then
-   echo "ERRORS found in log files. See $errfile."
+   echo "ERRORS found in log files. See $errfile"
 else
    echo "Congratulations! No errors found in log files."
    export flag_reboot=1
 fi
+
+#!/bin/bash
+# code snipplet by Henning Glawe
+#
+# FAI_CONFIG_AREA is set by subroutines/get_fai_cvs to the directory where the
+# configuration is to be stored
+# 
+# the old contents are rotated to $FAI_CONFIG_AREA.old
+
+
+if [ -n "$FAI_CONFIG_AREA" ] ; then
+	echo "Saving installtime configuration to $FAI_CONFIG_AREA"
+       
+	cp -a "$FAI" "${FAI_CONFIG_AREA}.new"
+	[ -d "${FAI_CONFIG_AREA}.old" ] && rm -rf "${FAI_CONFIG_AREA}.old"
+	mv "$FAI_CONFIG_AREA" "${FAI_CONFIG_AREA}.old"
+	mv "${FAI_CONFIG_AREA}.new" "$FAI_CONFIG_AREA"
+fi




More information about the D-community-commits mailing list