From d84190750284b9cf5a5d35d569f952494dd3e231 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Tue, 10 Mar 2009 23:07:24 +0100 Subject: [PATCH] dinstall use an own onerror function sending a mail about the failure of dinstall. Signed-off-by: Joerg Jaspert --- config/debian/cron.dinstall | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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}" -- 2.39.2