[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, master, updated. 148332ef45997ba3aaf38cc2c9a28441083bad49
Andreas Beckmann
debian at abeckmann.de
Fri Dec 23 10:24:10 UTC 2011
The following commit has been merged in the master branch:
commit 33c5faf215924e9582dd19f7c729e5d812f5870f
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Mon Nov 28 02:57:05 2011 +0100
add new cronscript to run piuparts-analyze
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/home/piupartss/bin/slave_run b/home/piupartsm/bin/report_newly_bugged_packages
similarity index 50%
copy from home/piupartss/bin/slave_run
copy to home/piupartsm/bin/report_newly_bugged_packages
index 1f79314..221a5fe 100755
--- a/home/piupartss/bin/slave_run
+++ b/home/piupartsm/bin/report_newly_bugged_packages
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2009-2011 Holger Levsen (holger at layer-acht.org)
+# Copyright © 2011 Andreas Beckmann <debian at abeckmann.de>
#
# 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
@@ -16,22 +16,30 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# run piuparts-slave in screen so that a screendump can be mailed via cron to monitor the slave
-#
-set -e
-SCREENLOG=/org/piuparts.debian.org/slave/screenlog.0
-MONITORDIR=/org/piuparts.debian.org/master/monitor-slave
-export PYTHONPATH=/org/piuparts.debian.org/lib/python2.6/dist-packages:/org/piuparts.debian.org/lib/python2.7/dist-packages
+PIUPARTS_CONF=${PIUPARTS_CONF:-/etc/piuparts/piuparts.conf}
+
+get_config_value()
+{
+ local key value
+ key="$1"
+ value="$(sed -rn -e "/^$key\s*=/s/^$key\s*=\s*//p" "$PIUPARTS_CONF")"
+ if [ -z "$value" ]; then
+ echo "'$key' not set in $PIUPARTS_CONF, exiting."
+ exit 1
+ fi
+ echo "$value"
+}
-cd /org/piuparts.debian.org/slave
-(ps fax|grep -v grep| grep piuparts-slave ) && exit 0
-rm -f $SCREENLOG # used by ~piupartsm/bin/detect_slave_problems
-rm -f $MONITORDIR/* # used by several scripts to only warn once a day
+MASTER=$(get_config_value master-directory)
+SECTIONS=$(get_config_value sections)
-trap "cat $SCREENLOG | mail -s 'slave abnormaly ended' piupartsm ; rm $SCREENLOG; exit" TERM EXIT
-screen -L -d -m -S piuparts-slave-screen su - piupartss -c "cd /org/piuparts.debian.org/slave && PYTHONPATH=$PYTHONPATH python ../share/piuparts/piuparts-slave"
-trap - TERM EXIT
+export PYTHONPATH=/org/piuparts.debian.org/lib/python2.6/dist-packages:/org/piuparts.debian.org/lib/python2.7/dist-packages
-echo "piuparts-slave has been started."
+for SECTION in $SECTIONS ; do
+ if [ -d $MASTER/$SECTION ]; then
+ echo $SECTION
+ cd $MASTER/$SECTION
+ /org/piuparts.debian.org/share/piuparts/piuparts-analyze
+ fi
+done
--
piatti.debian.org configuration files
More information about the Piuparts-commits
mailing list