[dak/master] config/debian/cron.hourly: remove unchecked lock on failure
---
config/debian/cron.hourly | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/config/debian/cron.hourly b/config/debian/cron.hourly
index cbc687f..51f9d81 100755
--- a/config/debian/cron.hourly
+++ b/config/debian/cron.hourly
@@ -20,10 +20,16 @@ dak import-users-from-passwd
# do not run show-new and other stuff in parallel
LOCKFILE="$lockdir/unchecked.lock"
+cleanup() {
+ rm -f "${LOCKFILE}"
+}
+
if lockfile -r16 $LOCKFILE 2> /dev/null; then
+ trap cleanup EXIT
do_new
dak show-new > /dev/null || true
- rm -f $LOCKFILE
+ cleanup
+ trap - EXIT
fi
dak queue-report -n > $webdir/new.html
--
1.7.2.5
Reply to: