[Piuparts-commits] rev 645 - in piatti/home/piupartsm: . bin
Holger Levsen
holger at alioth.debian.org
Tue Feb 23 01:34:44 UTC 2010
Author: holger
Date: 2010-02-23 01:34:43 +0000 (Tue, 23 Feb 2010)
New Revision: 645
Added:
piatti/home/piupartsm/bin/report_stale_reserved_packages
Modified:
piatti/home/piupartsm/crontab
Log:
add new check for stale reserved packages and prepare crontab for daily report webpage
Copied: piatti/home/piupartsm/bin/report_stale_reserved_packages (from rev 636, piatti/home/piupartsm/bin/report_untestable_packages)
===================================================================
--- piatti/home/piupartsm/bin/report_stale_reserved_packages (rev 0)
+++ piatti/home/piupartsm/bin/report_stale_reserved_packages 2010-02-23 01:34:43 UTC (rev 645)
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# Copyright 2009,2010 Holger Levsen (holger at layer-acht.org)
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# parse config file
+#
+
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# =#=#g" -e "s#= #=#g" -e 's#=#="#' -e 's#$#"#' -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z "$MASTER" ] || [ -z "$SECTIONS" ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
+#
+# find packages which have been reserved for more than 2 days and unschedule them
+#
+
+LOGS=`mktemp`
+find $MASTER/*/reserved/ -mtime +2 -name "*.log" 2>/dev/null > $LOGS
+if [ -s $LOGS ] ; then
+ for SECTION in $SECTIONS ; do
+ for package_log in $(grep $SECTION $LOGS) ; do
+ rm -f $package_log
+ done
+ done
+ echo "Stale reserved packages detected, which have been reserved more then 2 days ago!"
+ echo "These packages have been unscheduled."
+ echo
+ cat "$LOGS"
+fi
+rm $LOGS
Modified: piatti/home/piupartsm/crontab
===================================================================
--- piatti/home/piupartsm/crontab 2010-02-23 01:17:55 UTC (rev 644)
+++ piatti/home/piupartsm/crontab 2010-02-23 01:34:43 UTC (rev 645)
@@ -4,7 +4,7 @@
# create reports once a day
# (dinstall runs 1|7|13|19:52, so this is long after mirror pushes...)
#
-0 0 * * * ( /home/piupartsm/bin/detect_well_known_errors ; find /org/piuparts.debian.org/master/*/fail -type f -mtime 1 -exec ls -rt1 {} \;|sed s#^/org/#http://#g | sed s#/master/#/#g ; PYTHONPATH=/org/piuparts.debian.org/lib/python2.5/site-packages:/org/piuparts.debian.org/lib/python2.6/site-packages nice python /org/piuparts.debian.org/share/piuparts/piuparts-report 2>&1 ) | mail -s piuparts-report piupartsm
+0 0 * * * ( /home/piupartsm/bin/detect_well_known_errors ; find /org/piuparts.debian.org/master/*/fail -type f -mtime 1 -exec ls -rt1 {} \;|sed s#^/org/#http://#g | sed s#/master/#/#g ; PYTHONPATH=/org/piuparts.debian.org/lib/python2.5/site-packages:/org/piuparts.debian.org/lib/python2.6/site-packages nice python /org/piuparts.debian.org/share/piuparts/piuparts-report 2>&1 ) > /org/piuparts.debian.org/htdocs/dailyreport.txt ; cat /org/piuparts.debian.org/htdocs/dailyreport.txt | mail -s piuparts-report piupartsm # failures of the day it should be, the rest is boring.
#
# monitor slave session every hour
@@ -19,13 +19,15 @@
#
# monitor for problems once a day
#
+# FIXME now: use run-parts
45 22 * * * /home/piupartsm/bin/detect_stale_mounts
50 22 * * * /home/piupartsm/bin/detect_tmp_cruft
55 22 * * * /home/piupartsm/bin/detect_network_issues
0 23 * * * /home/piupartsm/bin/detect_archive_issues
5 23 * * * /home/piupartsm/bin/detect_piuparts_issues
10 23 * * * /home/piupartsm/bin/report_untestable_packages
-15 23 * * * /home/piupartsm/bin/archive_old_logs
+20 23 * * * /home/piupartsm/bin/report_stale_reserved_packages
+25 23 * * * /home/piupartsm/bin/archive_old_logs
#
# misc
More information about the Piuparts-commits
mailing list