[dak/master] dinstall
use an own onerror function sending a mail about the failure of dinstall.
Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
config/debian/cron.dinstall | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall
index 33de833..9b52409 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}"
--
1.5.6.5
Reply to: