From: Torsten Werner Date: Thu, 10 Feb 2011 12:49:02 +0000 (+0100) Subject: Really fix locking behaviour of dinstall. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=a9071be19ea09e62c94cd5c3f2acf6ecf8e76aa1;p=dak.git Really fix locking behaviour of dinstall. Signed-off-by: Torsten Werner --- diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index d66e2348..6f7cf0d8 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -159,7 +159,7 @@ state "Startup" lockfile -l 3600 "${LOCK_DAILY}" trap onerror ERR -trap cleanup EXIT TERM HUP INT QUIT +trap remove_daily_lock EXIT TERM HUP INT QUIT touch "${LOCK_BRITNEY}" @@ -205,6 +205,7 @@ stage $GO lockfile "$LOCK_ACCEPTED" lockfile "$LOCK_NEW" +trap remove_all_locks EXIT TERM HUP INT QUIT GO=( FUNC="punew" @@ -381,7 +382,8 @@ GO=( ) stage $GO -remove_locks +remove_all_locks +trap - EXIT TERM HUP INT QUIT ts "locked part finished" state "postlock" diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions index 1834841b..be4ed572 100644 --- a/config/debian/dinstall.functions +++ b/config/debian/dinstall.functions @@ -4,14 +4,14 @@ function ts() { echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)" } -# Remove all locks -function remove_locks() { - rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW +# Remove daily lock +function remove_daily_lock() { + rm -f $LOCK_DAILY } -# trap handler for cleaning up on signal / error -function cleanup() { - remove_locks +# Remove all locks +function remove_all_locks() { + rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW } # If we error out this one is called, *FOLLOWED* by cleanup above