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:
@@ -128,6 +128,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
if ! command -v docker &>/dev/null; then
|
if ! command -v docker &>/dev/null; then
|
||||||
error "Docker command not found"
|
error "Docker command not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
if ! command -v docker &>/dev/null; then
|
if ! command -v docker &>/dev/null; then
|
||||||
error "Docker command not found"
|
error "Docker command not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
if ! command -v docker &>/dev/null; then
|
if ! command -v docker &>/dev/null; then
|
||||||
error "Docker command not found"
|
error "Docker command not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
if ! command -v python3 >/dev/null 2>&1; then
|
if ! command -v python3 >/dev/null 2>&1; then
|
||||||
echo "ERROR: python3 not found — required for arr_cleanup" >&2
|
echo "ERROR: python3 not found — required for arr_cleanup" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
# detect_hosts() sets MY_ID and aliases all HOST*_WATCHDOG_* arrays
|
# detect_hosts() sets MY_ID and aliases all HOST*_WATCHDOG_* arrays
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ parse_args "${FILTERED_ARGS[@]}"
|
|||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
[[ "$EUID" -ne 0 ]] && { error "Must be run as root"; exit 1; }
|
[[ "$EUID" -ne 0 ]] && { error "Must be run as root"; exit 1; }
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
|
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
validate_unraid_cmd \
|
validate_unraid_cmd \
|
||||||
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
||||||
"" "" \
|
"" "" \
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
acquire_lock
|
||||||
|
|
||||||
validate_unraid_cmd \
|
validate_unraid_cmd \
|
||||||
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
||||||
"" "" \
|
"" "" \
|
||||||
|
|||||||
Reference in New Issue
Block a user