[Piuparts-commits] rev 335 - in piatti/home: piupartsm piupartsm/bin piupartss/bin
Holger Levsen
holger at alioth.debian.org
Sat Apr 11 11:42:24 UTC 2009
Author: holger
Date: 2009-04-11 11:42:24 +0000 (Sat, 11 Apr 2009)
New Revision: 335
Modified:
piatti/home/piupartsm/bin/detect_slave_problems
piatti/home/piupartsm/crontab
piatti/home/piupartss/bin/detect_leftover_processes
piatti/home/piupartss/bin/slave_run
Log:
only send mail about leftover_processes once per day
Modified: piatti/home/piupartsm/bin/detect_slave_problems
===================================================================
--- piatti/home/piupartsm/bin/detect_slave_problems 2009-04-10 23:07:37 UTC (rev 334)
+++ piatti/home/piupartsm/bin/detect_slave_problems 2009-04-11 11:42:24 UTC (rev 335)
@@ -27,10 +27,12 @@
SCREENLOG=/org/piuparts.debian.org/slave/screenlog.0
MONITORDIR=/org/piuparts.debian.org/master/monitor-slave
-LOCKFILE="$MONITORDIR/mail-sent"
+LOCKFILE="$MONITORDIR/slave-problems"
mkdir -p $MONITORDIR
cd $MONITORDIR
+chown piupartsm.piuparts $MONITORDIR
+chmod 775 $MONITORDIR
# ~piupartss/bin/slave_run deletes screenlog.old so we know piuparts-slave has just been started
mv screenlog.new screenlog.old || cp $SCREENLOG screenlog.old
Modified: piatti/home/piupartsm/crontab
===================================================================
--- piatti/home/piupartsm/crontab 2009-04-10 23:07:37 UTC (rev 334)
+++ piatti/home/piupartsm/crontab 2009-04-11 11:42:24 UTC (rev 335)
@@ -18,7 +18,7 @@
#
# make sure slave is reminded daily (and also monitored if not started with ~piupartss/bin/slave_run)
#
-23 0 * * * rm -f /org/piuparts.debian.org/master/monitor-slave/mail-sent
+23 0 * * * rm -f /org/piuparts.debian.org/master/monitor-slave/*
#
# monitor for problems once a day
Modified: piatti/home/piupartss/bin/detect_leftover_processes
===================================================================
--- piatti/home/piupartss/bin/detect_leftover_processes 2009-04-10 23:07:37 UTC (rev 334)
+++ piatti/home/piupartss/bin/detect_leftover_processes 2009-04-11 11:42:24 UTC (rev 335)
@@ -16,8 +16,11 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+MONITORDIR=/org/piuparts.debian.org/master/monitor-slave
+LOCKFILE="$MONITORDIR/leftover_processes"
+
OUTPUT=$(sudo ls /proc/*/root -lad 2>/dev/null|grep "/org/piuparts.debian.org/tmp" | grep "(deleted)")
-if [ "$OUTPUT" != "" ] ; then
+if [ "$OUTPUT" != "" ] && [ "$(cat $LOCKFILE)" != "$OUTPUT" ] ; then
echo "Found processes running with a deleted chroot in /org/piuparts.debian.org/tmp/"
echo "This is usually because of 'FAIL: Processes are running inside chroot'"
echo
@@ -25,4 +28,9 @@
echo
echo "Please cleanup manually."
echo "#522918 has been filed to make this manual operation unneeded."
+ mkdir -p $MONITORDIR
+ chown piupartsm.piuparts $MONITORDIR
+ chmod 775 $MONITORDIR
+ echo $OUTPUT > $LOCKFILE
+ chmod 664 $LOCKFILE
fi
Modified: piatti/home/piupartss/bin/slave_run
===================================================================
--- piatti/home/piupartss/bin/slave_run 2009-04-10 23:07:37 UTC (rev 334)
+++ piatti/home/piupartss/bin/slave_run 2009-04-11 11:42:24 UTC (rev 335)
@@ -5,9 +5,8 @@
set -e
cd /org/piuparts.debian.org/slave
(ps fax|grep -v grep| grep piuparts-slave ) && exit 0
-rm -f /org/piuparts.debian.org/slave/screenlog.0 # used by ~piupartsm/bin/detect_slave_problems
-rm -f /org/piuparts.debian.org/master/monitor-slave/mail-sent # to only warn once a day about piuparts hanging
-rm -f /org/piuparts.debian.org/master/monitor-slave/screenlog.old # and not to warn when it was just started
+rm -f /org/piuparts.debian.org/slave/screenlog.0 # used by ~piupartsm/bin/detect_slave_problems
+rm -f /org/piuparts.debian.org/master/monitor-slave/* # used by several scripts to only warn once a day
screen -L -d -m -S piuparts-slave-screen su - piupartss -c "cd /org/piuparts.debian.org/slave && python ../share/piuparts/piuparts-slave"
More information about the Piuparts-commits
mailing list