From: Joerg Jaspert Date: Tue, 10 Mar 2009 22:07:24 +0000 (+0100) Subject: dinstall X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d84190750284b9cf5a5d35d569f952494dd3e231;p=dak dinstall use an own onerror function sending a mail about the failure of dinstall. Signed-off-by: Joerg Jaspert --- diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 33de8339..9b524092 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -43,6 +43,12 @@ function cleanup() { rm -f ${LOCK_ACCEPTED} } +# If we error out this one is called, *FOLLOWED* by cleanup above +function onerror() { + ERRDATE=$(date "+%Y.%m.%d-%H:%M:%S") + cat "$LOGFILE" | mail -s "ATTENTION ATTENTION! dinstall error at ${ERRDATE} (Be quiet, Brain, or I'll stab you with a Q-tip)" cron@ftp-master.debian.org +} + ######################################################################## # the actual dinstall functions follow # ######################################################################## @@ -486,7 +492,8 @@ LOCK_BRITNEY="$lockdir/britney.lock" LOCK_STOP="$lockdir/archive.stop" lockfile -l 3600 "${LOCK_DAILY}" -trap cleanup EXIT ERR TERM HUP INT QUIT +trap onerror ERR +trap cleanup EXIT TERM HUP INT QUIT touch "${LOCK_BRITNEY}"