From 740710e0d0f234fa7e9bfdb484a9cd51c3a387e3 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Wed, 20 May 2026 18:03:03 -0400 Subject: [PATCH] Add missing acquire_lock to 8 scripts across Docker_Essentials, Rsync, Partnership, Old_Arch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker_container_stop, docker_update, docker_update_remaining — concurrent Docker operations on the same containers would conflict; now locked. rsync.sh — two rsync processes running against the same share simultaneously would produce incomplete or corrupted mirrors; now locked. partnership_onboard, ssh_setup — one-shot setup scripts that mutate SSH config and deploy containers; concurrent runs would produce undefined state; now locked. Old_Arch_Still_Works: arr_cleanup, continuous_scripts_status — legacy scripts still sourcing load_config.sh; added lock for consistency even in old-arch context. partnership_manager.sh intentionally left unchanged — it uses a conditional lock that excludes read-only "check" mode and "offboard" mode (which delegates to partnership_offboard.sh, which has its own lock). --- Docker_Essentials/docker_container_stop.sh | 2 ++ Docker_Essentials/docker_update.sh | 2 ++ Docker_Essentials/docker_update_remaining.sh | 2 ++ Old_Arch_Still_Works/arr_cleanup.sh | 2 ++ Old_Arch_Still_Works/continuous_scripts_status.sh | 2 ++ Partnership/partnership_onboard.sh | 2 ++ Partnership/ssh_setup.sh | 2 ++ Rsync/rsync.sh | 2 ++ 8 files changed, 16 insertions(+) diff --git a/Docker_Essentials/docker_container_stop.sh b/Docker_Essentials/docker_container_stop.sh index 3006063..e5bb137 100755 --- a/Docker_Essentials/docker_container_stop.sh +++ b/Docker_Essentials/docker_container_stop.sh @@ -128,6 +128,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + if ! command -v docker &>/dev/null; then error "Docker command not found" exit 1 diff --git a/Docker_Essentials/docker_update.sh b/Docker_Essentials/docker_update.sh index 001ffb7..1d36ba9 100644 --- a/Docker_Essentials/docker_update.sh +++ b/Docker_Essentials/docker_update.sh @@ -142,6 +142,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + if ! command -v docker &>/dev/null; then error "Docker command not found" exit 1 diff --git a/Docker_Essentials/docker_update_remaining.sh b/Docker_Essentials/docker_update_remaining.sh index 026e900..ee05fb6 100644 --- a/Docker_Essentials/docker_update_remaining.sh +++ b/Docker_Essentials/docker_update_remaining.sh @@ -85,6 +85,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + if ! command -v docker &>/dev/null; then error "Docker command not found" exit 1 diff --git a/Old_Arch_Still_Works/arr_cleanup.sh b/Old_Arch_Still_Works/arr_cleanup.sh index 70911da..9f69f43 100755 --- a/Old_Arch_Still_Works/arr_cleanup.sh +++ b/Old_Arch_Still_Works/arr_cleanup.sh @@ -33,6 +33,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + if ! command -v python3 >/dev/null 2>&1; then echo "ERROR: python3 not found — required for arr_cleanup" >&2 exit 1 diff --git a/Old_Arch_Still_Works/continuous_scripts_status.sh b/Old_Arch_Still_Works/continuous_scripts_status.sh index 9195016..6627f3a 100644 --- a/Old_Arch_Still_Works/continuous_scripts_status.sh +++ b/Old_Arch_Still_Works/continuous_scripts_status.sh @@ -61,6 +61,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + # detect_hosts() sets MY_ID and aliases all HOST*_WATCHDOG_* arrays detect_hosts diff --git a/Partnership/partnership_onboard.sh b/Partnership/partnership_onboard.sh index 28df983..0d59f5c 100755 --- a/Partnership/partnership_onboard.sh +++ b/Partnership/partnership_onboard.sh @@ -156,6 +156,8 @@ parse_args "${FILTERED_ARGS[@]}" # ============================================================================================== [[ "$EUID" -ne 0 ]] && { error "Must be run as root"; exit 1; } +acquire_lock + detect_hosts OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}" diff --git a/Partnership/ssh_setup.sh b/Partnership/ssh_setup.sh index 507d430..5d8551f 100755 --- a/Partnership/ssh_setup.sh +++ b/Partnership/ssh_setup.sh @@ -66,6 +66,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + validate_unraid_cmd \ "/usr/local/emhttp/plugins/dynamix/scripts/notify" \ "" "" \ diff --git a/Rsync/rsync.sh b/Rsync/rsync.sh index c1e7327..9fa7775 100644 --- a/Rsync/rsync.sh +++ b/Rsync/rsync.sh @@ -163,6 +163,8 @@ if [[ "$EUID" -ne 0 ]]; then exit 1 fi +acquire_lock + validate_unraid_cmd \ "/usr/local/emhttp/plugins/dynamix/scripts/notify" \ "" "" \