From aa8beb37949bf90f7bf3695ede3e2c4a6f873226 Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Wed, 19 Aug 2026 20:17:47 +0200 Subject: [PATCH] 0.9.6.30: globales Lauf-Lock gegen Parallelstarts --- runtime/run-all.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/run-all.sh b/runtime/run-all.sh index 2c0ffb7..65582eb 100644 --- a/runtime/run-all.sh +++ b/runtime/run-all.sh @@ -5,6 +5,14 @@ SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" PIWIGO_ROOT_DEFAULT="${BRATONIEN_NC_PIWIGO_ROOT:-$(cd -- "$SCRIPT_DIR/../../.." && pwd)}" CONFIG_DIR="${BRATONIEN_NC_CONFIG_DIR:-/etc/bratonien-tools/nc-connector}" NATIVE_MODE="${BRATONIEN_NC_NATIVE:-0}" +GLOBAL_LOCK_DIR="${PIWIGO_ROOT_DEFAULT%/}/_data/bratonien-tools/nc-connector-scheduler" +GLOBAL_LOCK_FILE="$GLOBAL_LOCK_DIR/worker.lock" +mkdir -p -- "$GLOBAL_LOCK_DIR" +exec 8>"$GLOBAL_LOCK_FILE" +if ! flock -n 8; then + echo "NC Connector: ein Lauf ist bereits aktiv." + exit 0 +fi shopt -s nullglob read_config_value() {