From c3b3a4c70f39303ef429beb6a865716a1e115b35 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Tue, 11 Apr 2023 20:50:59 +0200 Subject: [PATCH] Remove lock file if inhibiting tasks --- bin/runner.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/runner.sh b/bin/runner.sh index d9e0f0c..9d689e9 100755 --- a/bin/runner.sh +++ b/bin/runner.sh @@ -90,6 +90,12 @@ function run () { rm $STDOUTLOG $STDERRLOG } +function cleanup () { + if [[ -f $LOCKFILE ]]; then + rm "$LOCKFILE" + fi +} + if [[ -f $LOCKFILE ]]; then PID=$(cat "$LOCKFILE") if pgrep -F "$LOCKFILE"; then @@ -110,6 +116,7 @@ print_info "Start run" print_log "Check if data is accessible" $BINDIR/check_mounts_present.py || { print_warning "Import mounts not accessible. Inhibiting all tasks!" + cleanup exit 253 }