From a0a46ce6cf3a69cfc1bc5921df7c37601bb401c2 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 14 Dec 2015 15:35:35 +0100 Subject: reproducible rpms: refactor and increase timeout for a single build to 8h (was 4h) --- bin/reproducible_build_rpm.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_build_rpm.sh b/bin/reproducible_build_rpm.sh index b61efdf1..6b12d298 100755 --- a/bin/reproducible_build_rpm.sh +++ b/bin/reproducible_build_rpm.sh @@ -96,12 +96,12 @@ first_build() { download_package local RESULTDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)" local LOG=$TMPDIR/b1/$SRCPACKAGE/build1.log - # nicely run mock with a timeout of 4h - timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \ + # nicely run mock with a timeout of $TIMEOUT hours + timeout -k $TIMEOUT.1h ${TIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \ mock -r $RELEASE-$ARCH --resultdir=$RESULTDIR --cleanup-after -v --rebuild $SRC_RPM 2>&1 | tee -a $LOG PRESULT=${PIPESTATUS[0]} if [ $PRESULT -eq 124 ] ; then - echo "$(date -u) - mock was killed by timeout after 4h." | tee -a $LOG + echo "$(date -u) - mock was killed by timeout after ${TIMEOUT}h." | tee -a $LOG fi if ! "$DEBUG" ; then set +x ; fi } @@ -118,12 +118,12 @@ second_build() { local RESULTDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)" local LOG=$TMPDIR/b2/$SRCPACKAGE/build2.log # NEW_NUM_CPU=$(echo $NUM_CPU-1|bc) - # nicely run mock with a timeout of 4h - timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \ + # nicely run mock with a timeout of $TIMEOUT hours + timeout -k $TIMEOUT.1h ${TIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \ mock -r $RELEASE-$ARCH --resultdir=$RESULTDIR --cleanup-after -v --rebuild $SRC_RPM 2>&1 | tee -a $LOG PRESULT=${PIPESTATUS[0]} if [ $PRESULT -eq 124 ] ; then - echo "$(date -u) - mock was killed by timeout after 4h." | tee -a $LOG + echo "$(date -u) - mock was killed by timeout after ${TIMEOUT}h." | tee -a $LOG fi if ! "$DEBUG" ; then set +x ; fi } @@ -173,6 +173,7 @@ TMPDIR=$(mktemp --tmpdir=/srv/reproducible-results -d) # where everything actua trap cleanup_all INT TERM EXIT cd $TMPDIR +TIMEOUT=8 # maximum time in hours for a single build DATE=$(date -u +'%Y-%m-%d %H:%M') START=$(date +'%s') DUMMY=$(mktemp -t rpm-dummy-XXXXXXXX) -- cgit v1.2.3-70-g09d2