From f36d4dc72fab1bc42d5689151cee2a433f5c2c68 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Mon, 7 Aug 2023 13:23:35 -0700 Subject: sign-sync-binpackages: refactor lockfile Signed-off-by: Robin H. Johnson --- sign-sync-binpackages.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sign-sync-binpackages.sh b/sign-sync-binpackages.sh index 7db6611..4dfe034 100755 --- a/sign-sync-binpackages.sh +++ b/sign-sync-binpackages.sh @@ -43,15 +43,17 @@ export BINPKG_GPG_SIGNING_GPG_HOME=/home/gmirror/.gnupg-releng export BINPKG_GPG_SIGNING_KEY=13EBBDBEDE7A12775DFDB1BABB572E0E2D182910 export BINPKG_GPG_VERIFY_GPG_HOME=${BINPKG_GPG_SIGNING_GPG_HOME} +export LOCKFILE=${STAGINGTREE}/.running + # this script needs to be run as gmirror user [[ $(whoami) == "gmirror" ]] || exit 111 # we make sure we're not running twice in parallel -if [[ -f ${STAGINGTREE}/.running ]] ; then - echo sign-sync-binpackages.sh lockfile ${STAGINGTREE}/.running exists, aborting +if [[ -f ${LOCKFILE} ]] ; then + echo sign-sync-binpackages.sh lockfile ${LOCKFILE} exists, aborting exit 112 fi -touch ${STAGINGTREE}/.running || exit 110 +touch ${LOCKFILE} || exit 110 # make sure we have an updated gpg-agent gpgconf --kill all @@ -114,4 +116,4 @@ done # we're done so remove the "lockfile" -rm ${STAGINGTREE}/.running +rm ${LOCKFILE} -- cgit v1.2.3-65-gdbad