[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, piatti, updated. 0.43-15-g9510d05
Andreas Beckmann
debian at abeckmann.de
Tue Jan 31 07:59:52 UTC 2012
The following commit has been merged in the piatti branch:
commit e8915123314b1362016dd38db2258a977f56ac8c
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Wed Jan 25 18:46:28 2012 +0100
add master_cleanup script and run it after reboot
After a crash we need to cleanup $HTDOCS/daily.lock, otherwise
daily processing won't continue.
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/home/piupartsm/bin/detect_tmp_cruft b/home/piupartsm/bin/master_cleanup
similarity index 72%
copy from home/piupartsm/bin/detect_tmp_cruft
copy to home/piupartsm/bin/master_cleanup
index bbb8e9e..f138482 100755
--- a/home/piupartsm/bin/detect_tmp_cruft
+++ b/home/piupartsm/bin/master_cleanup
@@ -1,21 +1,28 @@
#!/bin/sh
+set -e
-# Copyright 2009 Holger Levsen (holger at layer-acht.org)
-#
+# Copyright © 2012 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
# 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
+#
+# cleanup $HTDOCS/daily.lock
+#
+# - this should only be run (automatically) on boot
+#
+
PIUPARTS_CONF=${PIUPARTS_CONF:-/etc/piuparts/piuparts.conf}
[ -f "$PIUPARTS_CONF" ] || exit 0
@@ -36,18 +43,14 @@ get_config_value()
eval "$1"='"$value"'
}
-get_config_value PIUPARTS_TEMPDIR global tempdir /org/piuparts.debian.org/tmp
+get_config_value HTDOCS global output-directory
-LS_TMP=$(ls --color=never -l $PIUPARTS_TEMPDIR)
-if [ "$(echo "$LS_TMP" | wc -l)" -gt 12 ] ; then
- echo "More than ten directories in $PIUPARTS_TEMPDIR detected!"
- echo
- echo "$LS_TMP"
- echo
- echo "$(du -shx $PIUPARTS_TEMPDIR 2>/dev/null)"
- echo
- echo "One is normal for piuparts operation, more is not."
- echo "Please investigate and cleanup."
+LOCKFILE=$HTDOCS/daily.lock
+if [ -e $LOCKFILE ]; then
+ if pgrep -f generate_daily_report || pgrep -f piuparts-report ; then
+ echo "daily processing is running"
+ else
+ rm -f -v $LOCKFILE
+ fi
fi
-
diff --git a/home/piupartsm/crontab b/home/piupartsm/crontab
index 3b839e5..691466f 100644
--- a/home/piupartsm/crontab
+++ b/home/piupartsm/crontab
@@ -1,6 +1,11 @@
# m h dom mon dow (0|7=sun,1=mon) command
#
+# cleanup $HTDOCS/daily.lock
+#
+ at reboot $HOME/bin/master_cleanup
+
+#
# create reports once a day
# (dinstall runs 1|7|13|19:52, so this is long after mirror pushes...)
#
--
piatti.debian.org configuration files
More information about the Piuparts-commits
mailing list