Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2012 23:35:16 +0000 (UTC)
From:      Mark Linimon <linimon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r236211 - projects/portbuild/scripts
Message-ID:  <201205282335.q4SNZGEe040155@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: linimon (doc,ports committer)
Date: Mon May 28 23:35:16 2012
New Revision: 236211
URL: http://svn.freebsd.org/changeset/base/236211

Log:
  Clean up claim-chroots that failed (usually due to ssh timeout after copy
  to client).  This relieves pressure on /tmp on the clients.

Modified:
  projects/portbuild/scripts/cleanup-chroots

Modified: projects/portbuild/scripts/cleanup-chroots
==============================================================================
--- projects/portbuild/scripts/cleanup-chroots	Mon May 28 23:32:18 2012	(r236210)
+++ projects/portbuild/scripts/cleanup-chroots	Mon May 28 23:35:16 2012	(r236211)
@@ -14,6 +14,7 @@ pbd=${PORTBUILD_DATA:-/var/portbuild}
 REMOVE_EMPTY_BUILD_TIME=10080
 REMOVE_INUSE_CHROOT_TIME=7200
 REMOVE_NOTINUSE_CHROOT_TIME=60
+REMOVE_NOTINUSE_CLAIM_CHROOT_TIME=60
 
 #VERBOSE=1
 
@@ -163,3 +164,18 @@ if [ ! -z "${stale_builds}" ]; then
 	rm -rf ${build}
     done
 fi
+
+# cleanup claim-chroots that failed (usually due to ssh timeout after
+# copy to client)
+# XXX MCL assuming that mktemp using /tmp in claim-chroot
+stale_claim_chroots=$(find /tmp -name claim-chroot.* -prune -mmin +${REMOVE_NOTINUSE_CLAIM_CHROOT_TIME} 2> /dev/null)
+if [ ! -z "${stale_claim_chroots}" ]; then
+    if [ $VERBOSE ]; then
+	echo "cleanup-chroots: suspected stale claim_chroots on $(hostname):"
+	echo ${stale_claim_chroots}
+	echo
+    fi
+    for claim_chroot in ${stale_claim_chroots}; do
+	rm -rf ${claim_chroot}
+    done
+fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205282335.q4SNZGEe040155>