Signed-off-by: Torsten Werner <twerner@debian.org>
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}"
lockfile "$LOCK_ACCEPTED"
lockfile "$LOCK_NEW"
+trap remove_all_locks EXIT TERM HUP INT QUIT
GO=(
FUNC="punew"
)
stage $GO
-remove_locks
+remove_all_locks
+trap - EXIT TERM HUP INT QUIT
ts "locked part finished"
state "postlock"
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