Add missing acquire_lock to 8 scripts across Docker_Essentials, Rsync, Partnership, Old_Arch

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).
This commit is contained in:
Gmer4Lfe
2026-05-20 18:03:03 -04:00
parent 5c13495a6c
commit 740710e0d0
8 changed files with 16 additions and 0 deletions
@@ -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
+2
View File
@@ -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
@@ -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
+2
View File
@@ -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
@@ -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
+2
View File
@@ -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}"
+2
View File
@@ -66,6 +66,8 @@ if [[ "$EUID" -ne 0 ]]; then
exit 1
fi
acquire_lock
validate_unraid_cmd \
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
"" "" \
+2
View File
@@ -163,6 +163,8 @@ if [[ "$EUID" -ne 0 ]]; then
exit 1
fi
acquire_lock
validate_unraid_cmd \
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
"" "" \