feat: add fallback.sh --stop for clean array shutdown

Fallback runs as a bare subprocess (cmdline: bash .../Fallback/fallback.sh),
not via /tmp/user.scripts, so user_scripts_stop.sh cannot find it.
Adding --stop mode closes that gap in the array shutdown sequence.

fallback.sh --stop: reads lock file (/tmp/unraid_locks/fallback.lock) to
get the running PID, sends SIGTERM (hits the existing trap that sets
FALLBACK_RUNNING=false), waits up to 10s, SIGKILLs if still alive.

master.conf: insert Fallback/fallback.sh --stop as step 2 in
ARRAY_STOP_SCRIPTS (after user_scripts_stop, before rsync_stop).

user_script_plug-in.sh: update ARRAY STOPPING block to show 5-step order
and add v2.5 changelog entry.
This commit is contained in:
Gmer4Lfe
2026-05-18 22:04:07 -04:00
parent 75510cfd54
commit aa6d165725
3 changed files with 226 additions and 81 deletions
+4
View File
@@ -88,6 +88,9 @@
# resource_watchdog.sh: three-level pressure reduction (soft/medium/hard).
# docker_container_stop.sh: sequential verified container stop for shutdown.
# Path fixes: git_pull_execute.sh (root), continuous_scripts_status.sh (Tools/).
# v2.5 — fallback.sh --stop: added to ARRAY_STOP_SCRIPTS as step 2 (after user_scripts_stop,
# before rsync_stop) — fallback runs as a bare subprocess, not via /tmp/user.scripts,
# so it is not caught by user_scripts_stop.sh.
# ==============================================================================================
@@ -134,6 +137,7 @@
#
# Runs in order:
# user_scripts_stop.sh stop background user scripts first (prevents new operations)
# fallback.sh --stop gracefully stop fallback (not caught by user_scripts_stop)
# rsync_stop.sh --rsync-only kill rsync without triggering container recovery
# mover_stop.sh stop mover after rsync (both write to same paths)
# docker_container_stop.sh stop all containers one-by-one with verification