Add persistent partner conf backup across reboots

conf_cache_save.sh runs first on array stop — snapshots partner confs from RAM
cache to /boot/config/varaverk/conf_bak/ before anything else shuts down.

conf_cache_restore.sh runs after conf_sync.sh on array start — if partner was
unreachable and RAM cache is incomplete, loads the backup into RAM then removes
it. Normal reboots: backup written, fresh pull succeeds, backup deleted unused.
Edge case (partner down at boot): backup fills the gap so fallback.sh has the
partner vars it needs to operate correctly.
This commit is contained in:
Gmer4Lfe
2026-06-19 17:40:46 -04:00
parent ad98d41041
commit 7332eb81e0
4 changed files with 144 additions and 0 deletions
+2
View File
@@ -296,6 +296,7 @@
ARRAY_START_SCRIPTS=(
"Plugin/unraid/System_Essentials/unraid_api_key_renew.sh" # re-register Varaverk API key — registry is ephemeral
"System_Essentials/conf_sync.sh" # pull partner confs + push own conf into /tmp/.vv/ RAM cache
"System_Essentials/conf_cache_restore.sh" # load partner confs from persistent backup if conf_sync couldn't reach partner
"Transcodes/ramdisk_setup.sh" # creates ramdisk + symlink before Emby starts
"System_Essentials/docker_syslog_filter.sh" # suppress veth noise before logs fill
"Plugin/unraid/System_Essentials/php_fpm_max_children.sh" # WebGUI performance tuning
@@ -311,6 +312,7 @@
# Run sequentially (foreground) — each must complete before the next starts.
# Order matters: user scripts first (prevents new ops), then data movement, then containers.
ARRAY_STOP_SCRIPTS=(
"System_Essentials/conf_cache_save.sh" # snapshot partner conf RAM cache → /boot before anything stops
"Plugin/unraid/System_Essentials/user_scripts_stop.sh" # stop background scripts before they start new ops
"Fallback/fallback.sh --stop" # gracefully stop fallback (not caught by user_scripts_stop)
"System_Essentials/rsync_stop.sh --rsync-only" # kill rsync; skip container recovery (handled below)