From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9119C138350 for ; Wed, 29 Apr 2020 06:39:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C7F65E0831; Wed, 29 Apr 2020 06:39:28 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B13E3E0831 for ; Wed, 29 Apr 2020 06:39:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B714334EF83 for ; Wed, 29 Apr 2020 06:39:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 873DA1DD for ; Wed, 29 Apr 2020 06:39:25 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1588142358.8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546.robbat2@gentoo> Subject: [gentoo-commits] proj/gentoo-mirrorstats:master commit in: / X-VCS-Repository: proj/gentoo-mirrorstats X-VCS-Files: mirmon-wrapper.sh X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546 X-VCS-Branch: master Date: Wed, 29 Apr 2020 06:39:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3f1caef1-7c23-4b9a-9299-c3ca9902401c X-Archives-Hash: 352445508879d7d6f9c257f7af08173f commit: 8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546 Author: Robin H. Johnson gentoo org> AuthorDate: Wed Apr 29 06:39:18 2020 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Wed Apr 29 06:39:18 2020 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=8f37aa42 wrapper: ensure locking Signed-off-by: Robin H. Johnson gentoo.org> mirmon-wrapper.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh index 4c5570b..4fffee0 100755 --- a/mirmon-wrapper.sh +++ b/mirmon-wrapper.sh @@ -33,6 +33,8 @@ main() { CONFFILE=$(readlink -f "${CONFDIR}"/mirmon.conf) VAR_GMIRRORS=${VARDIR}/g.mirrors EXTRA_MIRRORS=${CONFDIR}/g.mirrors.extra + # Lock outselves + [ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "${VARDIR}/flock" "$0" "${OPTS[@]}" || : # Grab mirrors from the web mkdir -p "${VARDIR}" "${HTDOCS}" || die "Failed to mkdir" @@ -148,4 +150,5 @@ done [[ $INVALID -eq 1 ]] && usage [[ $HELP -eq 1 ]] && dohelp +OPTS=( ${opts} ) # for flock main