[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.49-41-g0b5d270
Andreas Beckmann
anbe at debian.org
Sun Feb 10 16:05:27 UTC 2013
The following commit has been merged in the develop branch:
commit cd85561073b08668241cefde45ff339c27275d7c
Author: Andreas Beckmann <anbe at debian.org>
Date: Fri Feb 8 18:37:53 2013 +0100
slave-bin/*: cleanup and unify script style
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/conf/crontab-slave b/conf/crontab-slave
index cbd7c2a..ed113c5 100644
--- a/conf/crontab-slave
+++ b/conf/crontab-slave
@@ -1,10 +1,6 @@
# m h dom mon dow (0|7=sun,1=mon) command
#
-# for normal checks, piupartsm's crontab should be used. This is only for tests which needs root priviledges
-#
-
-#
# start slave_run automatically after reboots
#
@reboot $HOME/bin/slave_cleanup ; sudo $HOME/bin/slave_run
diff --git a/debian/changelog b/debian/changelog
index 9119639..2eb68a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,8 +22,9 @@ piuparts (0.50) UNRELEASED; urgency=low
* slave_{run,join,cleanup}: Use pgrep to find running processes.
* detect_leftover_processes: Move statefile to slave-directory.
* detect_stale_mounts: Merge into detect_tmp_cruft.
- * detect_{slave_problems,tmp_cruft}: Move to slave-bin and run from slave
- crontab.
+ * detect_tmp_cruft: Move to slave-bin and run from slave crontab.
+ * detect_slave_problems:
+ - Move to slave-bin and run from slave crontab.
-- Andreas Beckmann <debian at abeckmann.de> Tue, 15 Jan 2013 11:51:43 +0100
diff --git a/slave-bin/detect_leftover_processes b/slave-bin/detect_leftover_processes
index bad945b..52672e0 100755
--- a/slave-bin/detect_leftover_processes
+++ b/slave-bin/detect_leftover_processes
@@ -44,6 +44,7 @@ get_config_value()
get_config_value SLAVEROOT global slave-directory
get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
+
STATEFILE=$SLAVEROOT/leftover_processes
# clear the statefile daily and whine again
@@ -57,12 +58,12 @@ if [ -z "$OUTPUT" ]; then
rm -f $STATEFILE
elif [ "$(cat $STATEFILE 2>/dev/null)" != "$OUTPUT" ]; then
echo "Found processes running with a deleted chroot in $PIUPARTS_TMPDIR"
- echo "This is usually because of 'FAIL: Processes are running inside chroot' which usually"
- echo "means the package violates 'must use invoke-rc.d (policy 9.3.3.2)'."
+ echo "This is usually because of 'FAIL: Processes are running inside chroot' which"
+ echo "usually means the package violates 'must use invoke-rc.d (policy 9.3.3.2)'."
echo
echo "$OUTPUT"
echo
echo "Please cleanup manually."
- echo "#522918 has been filed to make this manual operation unneeded."
+ echo "Since #522918 has been fixed this should no longer happen."
echo "$OUTPUT" > $STATEFILE
fi
diff --git a/slave-bin/detect_slave_problems b/slave-bin/detect_slave_problems
index b6f7942..f0caa97 100755
--- a/slave-bin/detect_slave_problems
+++ b/slave-bin/detect_slave_problems
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
# Copyright 2009-2010 Holger Levsen (holger at layer-acht.org)
#
@@ -16,10 +17,10 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-HOSTNAME=`hostname`
-if [ "$HOSTNAME" != "piatti" ] ; then
- exit 0
-fi
+#
+# this scripts monitors the output of piuparts-slave
+# when running in screen started by ~piupartss/bin/slave_run
+#
PIUPARTS_CONF=${PIUPARTS_CONF:-/etc/piuparts/piuparts.conf}
@@ -41,14 +42,15 @@ get_config_value()
eval "$1"='"$value"'
}
-get_config_value MASTER global master-directory
-get_config_value SECTIONS global sections
+
+HOSTNAME=`hostname`
+if [ "$HOSTNAME" != "piatti" ] ; then
+ exit 0
+fi
-#
-# this scripts monitors the output of piuparts-slave
-# when running in screen started by ~piupartss/bin/slave_run
-#
+get_config_value MASTER global master-directory
+
SCREENLOG=$MASTER/../slave/screenlog.0
MONITORDIR=$MASTER/monitor-slave
@@ -67,10 +69,14 @@ difference=$(( $unixtime - $stamptime ))
# FIXME: parse config file for duration...
if [ ! -f $LOCKFILE ] && [ ${difference} -ge 1860 ] ; then
{
- echo "Either a test is running for a very long time (but no test should run longer than an hour), piuparts-slave hangs or is not running at all or wasn't started with ~piupartss/bin/slave_run - please investigate and take appropriate measures!"
+ echo "Either a test is running for a very long time (but no test"
+ echo "should run longer than an hour), piuparts-slave hangs or is"
+ echo "not running at all or wasn't started with"
+ echo "~piupartss/bin/slave_run - please investigate and take"
+ echo "appropriate measures!"
echo
tail $SCREENLOG
- } | mail -s "problem with piuparts-slave detected" piupartsm
+ } | mail -s "problem with piuparts-slave detected" piupartss
touch $LOCKFILE
chmod 660 $LOCKFILE
fi
diff --git a/slave-bin/detect_tmp_cruft b/slave-bin/detect_tmp_cruft
index 14798a9..8c76631 100755
--- a/slave-bin/detect_tmp_cruft
+++ b/slave-bin/detect_tmp_cruft
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
# Copyright 2009 Holger Levsen (holger at layer-acht.org)
#
@@ -69,4 +70,3 @@ if [ "$(echo "$LS_TMP" | wc -l)" -gt 12 ] ; then
echo "Please investigate and cleanup."
echo
fi
-
diff --git a/slave-bin/slave_cleanup b/slave-bin/slave_cleanup
index 570312b..ea73149 100755
--- a/slave-bin/slave_cleanup
+++ b/slave-bin/slave_cleanup
@@ -18,7 +18,7 @@ set -e
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# cleanup /org/piuparts.debian.org/tmp/
+# cleanup old chroots etc. in $PIUPARTS_TMPDIR
#
# - this should only be run (automatically) on boot
#
--
piuparts git repository
More information about the Piuparts-commits
mailing list