From ff85b6b05720fe7929a90cabbed6a3dded070514 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 24 Oct 2007 11:08:37 +0200 Subject: [PATCH] Another logfile update (do not use ~log/fai/dirinstall but ~log/grml-live) --- buildd/functions.sh | 26 +++++++++++++++----------- debian/changelog | 3 +-- grml-live | 11 +++++------ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/buildd/functions.sh b/buildd/functions.sh index d33955b..566fa82 100755 --- a/buildd/functions.sh +++ b/buildd/functions.sh @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Mon Oct 22 19:19:26 CEST 2007 [mika] +# Latest change: Wed Oct 24 11:07:47 CEST 2007 [mika] ################################################################################ die() { @@ -33,12 +33,16 @@ MUTT_HEADERS=$(mktemp) [ -n "$ARCH" ] && GRML_LIVE_ARCH="-a $ARCH" # make sure we have same safe defaults: -[ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$" -[ -n "$ISO_DIR" ] || ISO_DIR=$STORAGE/grml-isos -[ -n "$RECIPIENT" ] || RECIPIENT=root@localhost -[ -n "$ATTACHMENT" ] || ATTACHMENT=$TMP_DIR/grml-live-logs_$DATE.tar.gz -[ -n "$LOGFILES" ] || LOGFILES=/var/log/fai/dirinstall/grml -[ -n "$FROM" ] || FROM=root@localhost +[ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$" +[ -n "$ISO_DIR" ] || ISO_DIR=$STORAGE/grml-isos +[ -n "$RECIPIENT" ] || RECIPIENT=root@localhost +[ -n "$ATTACHMENT" ] || ATTACHMENT=$TMP_DIR/grml-live-logs_$DATE.tar.gz +[ -n "$FAI_LOGFILES" ] || FAI_LOGFILES=/var/log/fai/dirinstall/grml +[ -n "$GRML_LOGFILES" ] || GRML_LOGFILES=/var/log/grml-live/ +[ -n "$FROM" ] || FROM=root@localhost + +[ -d "$FAI_LOGFILES" ] || mkdir -p $FAI_LOGFILES +[ -d "$GRML_LOGFILES" ] || mkdir -p $GRML_LOGFILES echo "my_hdr From: grml-live autobuild daemon <$FROM>" > $MUTT_HEADERS @@ -46,8 +50,8 @@ echo "my_hdr From: grml-live autobuild daemon <$FROM>" > $MUTT_HEADERS grml_live_run() { grml-live -F $GRML_LIVE_ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \ -g $NAME -v $DATE -r grml-live-autobuild -i $ISO_NAME \ - 1>$LOGFILES/grml-buildd.stdout \ - 2>$LOGFILES/grml-buildd.stderr ; RC=$? + 1>$GRML_LOGFILES/grml-buildd.stdout \ + 2>$GRML_LOGFILES/grml-buildd.stderr ; RC=$? if [ "$RC" = "0" ] ; then RC_INFO=success @@ -80,11 +84,11 @@ Return code of grml-live run was: $RC The following errors have been noticed (several might be warnings only): -$(grep error $LOGFILES/* | grep -ve liberror -ve libgpg-error || echo "* nothing") +$(grep error $FAI_LOGFILES/* | grep -ve liberror -ve libgpg-error || echo "* nothing") The following warnings have been noticed: -$(grep warn $LOGFILES/* || echo "* nothing") +$(grep warn $FAI_LOGFILES/* || echo "* nothing") Find details in the attached logs." | \ mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" \ diff --git a/debian/changelog b/debian/changelog index a274270..af1079f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,7 @@ grml-live (0.0.7) unstable; urgency=low grml-live.{stdout,stderr} as log files. - buildd/functions.sh: do not mv files if there was an error during grml-live execution - * Use version number of grml-live inside script and write it to - the logs as well. + * Display version number of grml-live. * Log executed grml-live command line. * Set FAI_DEBOOTSTRAP_OPTS="--exclude=dhcp-client,info" by default. diff --git a/grml-live b/grml-live index f4f299e..1ec32e5 100755 --- a/grml-live +++ b/grml-live @@ -71,12 +71,8 @@ trap bailout 1 2 3 15 [ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks" [ -n "$GRML_NAME" ] || GRML_NAME='grml' -[ -d /var/log/fai/dirinstall/"${HOSTNAME}" ] || mkdir -p /var/log/fai/dirinstall/${HOSTNAME} -if [ -d /var/log/fai/dirinstall/"${HOSTNAME}" ] ; then - LOGFILE=/var/log/fai/dirinstall/${HOSTNAME}/grml-live.log -else - LOGFILE="$LOGDIR/grml-live.log" -fi +[ -d /var/log/grml-live ] || mkdir /var/log/grml-live +LOGFILE=/var/log/grml-live/"$(date +%Y-%m-%d)_$$.log" NFSROOT_CONF=/etc/grml/fai/make-fai-nfsroot.conf @@ -212,6 +208,7 @@ if [ -z "$FORCE" ] ; then [ -n "$TEMPLATE_DIRECTORY" ] && echo " Template files: $TEMPLATE_DIRECTORY" [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS" [ -n "$VERBOSE" ] && echo " Using VERBOSE mode." + [ -n "$LOGFILE" ] && echo " Logging to file: $LOGFILE" echo echo -n "Is this ok for you? [y/N] " read a @@ -225,6 +222,8 @@ start_seconds=$(cut -d . -f 1 /proc/uptime) log "------------------------------------------------------------------------------" log "Starting grml-live [${GRML_LIVE_VERSION}] run [$(date)]" log "Executed command line: $0 $@" + +einfo "Logging actions to logfile $LOGFILE" # }}} # on-the-fly configuration {{{ -- 2.1.4