From 09d080a337aad83c7c072b423894d5a22521403f Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 8 Mar 2018 15:15:48 +1100 Subject: [PATCH] Add NO_TIMEOUT flag for reprepro During manual runs, you want to do this without a timeout. Add a flag; I always end up copying the script and manually editing this stuff in. Add a quick note in the AFS docs. Change-Id: I239bc1a0b5928673b42cc67291bb519d5f5d2471 --- doc/source/afs.rst | 4 +++- .../files/reprepro/reprepro-mirror-update.sh | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/source/afs.rst b/doc/source/afs.rst index c0d1aeb0ee..e77756b7e8 100644 --- a/doc/source/afs.rst +++ b/doc/source/afs.rst @@ -343,7 +343,9 @@ our mirror update cron jobs, manually perform the first mirror update: If using one of the mirror update scripts (from ``/usr/local/bin``) be aware that they generally run the update process under ``timeout`` with shorter periods than may be required for the - initial full sync. + initial full sync. e.g. for ``reprepro`` mirrors + + NO_TIMEOUT=1 /usr/local/bin/reprepro-mirror-update /etc/reprepro/ubuntu mirror.ubuntu * Log into ``afs01.dfw.openstack.org`` and run ``screen``. Within that session, periodically during the sync, and once again after it diff --git a/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh b/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh index 35956ffc48..dc61424419 100644 --- a/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh +++ b/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh @@ -16,12 +16,22 @@ set -e +# For initial clones, and debugging, set this for more verbose output +# that doesn't time out. +if [[ ${NO_TIMEOUT:-0} -eq 1 ]]; then + echo "Running interactively" + TIMEOUT="" + set -x +else + TIMEOUT="timeout -k 2m 90m" +fi + REPREPRO_CONFIG=$1 MIRROR_VOLUME=$2 BASE=`cat ${REPREPRO_CONFIG}/options | grep base | cut -d' ' -f2` UNREF_FILE=/var/run/reprepro/${MIRROR_VOLUME}.unreferenced-files -K5START="k5start -t -f /etc/reprepro.keytab service/reprepro -- timeout -k 2m 90m" +K5START="k5start -t -f /etc/reprepro.keytab service/reprepro -- ${TIMEOUT} " REPREPRO="$K5START reprepro --confdir $REPREPRO_CONFIG" date --iso-8601=ns