From b9b1d20499a857c0a4eadb87c5ae0c03c9178c81 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 31 May 2026 14:14:00 -0400 Subject: [PATCH] safeguard: skip watchdog cycle if array not started Exits cleanly before startup grace check if /mnt/user is not mounted as shfs. Prevents watchdogs running against Docker/storage that isn't available, and blocks false-positive reboots when array is stopped. Co-Authored-By: Claude Sonnet 4.6 --- Orchestrators/watchdog_orchestrator.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Orchestrators/watchdog_orchestrator.sh b/Orchestrators/watchdog_orchestrator.sh index 56d6e4c..4f69288 100755 --- a/Orchestrators/watchdog_orchestrator.sh +++ b/Orchestrators/watchdog_orchestrator.sh @@ -16,6 +16,11 @@ # System Watchdog last — only triggers if prior layers could not resolve the issue. # Rebooting without first reducing pressure may reboot into the same state. # +# ── ARRAY CHECK ─────────────────────────────────────────────────────────────────────────────── +# Exits immediately if /mnt/user is not mounted as shfs (array not started). +# Watchdogs check Docker containers and storage — meaningless without the array. +# Prevents false positives and unnecessary reboots when array is stopped or stopping. +# # ── STARTUP GRACE ───────────────────────────────────────────────────────────────────────────── # No action until system uptime >= WATCHDOG_STARTUP_GRACE seconds. # Prevents false positives from containers still starting at array launch. @@ -110,6 +115,14 @@ if [[ "$SHOW_STATUS" == true ]]; then exit 0 fi +# ============================================================================================== +# ━━━ Array Check ━━━ +# ============================================================================================== +if ! df --output=fstype /mnt/user 2>/dev/null | grep -q shfs; then + log "Array not started — skipping watchdog cycle" + exit 0 +fi + # ============================================================================================== # ━━━ Startup Grace ━━━ # ==============================================================================================