Add full banner headers to all scripts across the codebase
Every script now has the established header format: PURPOSE with ─────── separator, OPERATIONAL MODEL, DESIGN PRINCIPLES, OPERATIONAL SAFEGUARDS, CONFIGURATION, and RUNTIME MODES — structured with full ====== banner sections throughout. Orchestrators converted from compact ── inline format to full banners. Stale emby-fallback and dirty sync references removed from Plugin/user_script_plug-in.sh.
This commit is contained in:
@@ -19,6 +19,31 @@
|
||||
#
|
||||
# Silent when remote is online and no backup exists (normal state).
|
||||
# No-op when FALLBACK_ENABLED=false or CONF_SYNC_ENABLED=false.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# DESIGN PRINCIPLES
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Online = No Backup Needed
|
||||
# When the remote is reachable, conf_sync.sh will pull fresh on the next boot.
|
||||
# The persistent backup is removed — a stale backup is worse than no backup
|
||||
# because it can mask a connectivity problem that conf_sync.sh would catch.
|
||||
#
|
||||
# Offline = Stay Ready
|
||||
# While the remote is down, the RAM cache is the best available copy of partner
|
||||
# vars. Refreshing the persistent backup every 15 minutes ensures it reflects
|
||||
# the last-known-good state, not an old copy from days earlier.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL SAFEGUARDS
|
||||
# ==============================================================================================
|
||||
#
|
||||
# require_partnership — exits early if PARTNERSHIP_ENABLED=false
|
||||
# FALLBACK_ENABLED gate — exits if fallback is disabled
|
||||
# CONF_SYNC_ENABLED gate — exits if conf sync is disabled
|
||||
# REMOTE_ID presence check — exits if partner identity is unset
|
||||
# --dry-run mode — shows what would happen without touching the backup
|
||||
#
|
||||
# ==============================================================================================
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
@@ -2,32 +2,68 @@
|
||||
# ==============================================================================================
|
||||
# ================================= System Watchdog ============================================
|
||||
# ==============================================================================================
|
||||
#
|
||||
# PURPOSE
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# Thin orchestrator — runs SYSTEM_WATCHDOG_SCRIPTS from master.conf sequentially.
|
||||
# Called by watchdog_orchestrator.sh each cycle. Covers system component health:
|
||||
# storage pool growth, runaway logs, WebGUI availability, and network connectivity.
|
||||
#
|
||||
# ── EXECUTION ORDER ───────────────────────────────────────────────────────────────────────────
|
||||
# Driven by SYSTEM_WATCHDOG_SCRIPTS in master.conf — add, remove, or reorder there.
|
||||
# Default: storage_watchdog → webgui_watchdog → network_watchdog
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL MODEL
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Driven by SYSTEM_WATCHDOG_SCRIPTS in master.conf — add, remove, or reorder there.
|
||||
# Default: storage_watchdog → webgui_watchdog → network_watchdog
|
||||
#
|
||||
# ── SEQUENTIAL EXECUTION ─────────────────────────────────────────────────────────────────────
|
||||
# All scripts run in the foreground. Each must complete before the next starts.
|
||||
# A failed script is logged but does not prevent remaining scripts from running.
|
||||
#
|
||||
# ── SAFEGUARDS ────────────────────────────────────────────────────────────────────────────────
|
||||
# Root check — child scripts require root
|
||||
# acquire_lock — prevents concurrent system watchdog runs
|
||||
# detect_hosts() — MY_ID in notifications and logs
|
||||
# Non-fatal steps — a failed step is logged; remaining steps still run
|
||||
# ==============================================================================================
|
||||
# DESIGN PRINCIPLES
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Configuration Owns the List
|
||||
# SYSTEM_WATCHDOG_SCRIPTS in master.conf is the only place scripts are added
|
||||
# or removed. This orchestrator never needs to be edited to change what runs.
|
||||
#
|
||||
# Non-Fatal Steps
|
||||
# A failed watchdog step is logged and noted in the summary, but the remaining
|
||||
# steps still execute. Partial coverage is better than a halted watchdog chain.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL SAFEGUARDS
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Root check — child scripts require root
|
||||
# acquire_lock — prevents concurrent system watchdog runs
|
||||
# detect_hosts() — MY_ID in notifications and logs
|
||||
# Non-fatal steps — a failed step is logged; remaining steps still run
|
||||
#
|
||||
# ==============================================================================================
|
||||
# CONFIGURATION
|
||||
# ==============================================================================================
|
||||
#
|
||||
# master.conf
|
||||
#
|
||||
# ── CONFIGURATION (master.conf) ───────────────────────────────────────────────────────────────
|
||||
# SYSTEM_WATCHDOG_SCRIPTS — ordered list of system component watchdog scripts to run
|
||||
#
|
||||
# ── USAGE ─────────────────────────────────────────────────────────────────────────────────────
|
||||
# system_watchdog.sh — run all system component watchdogs
|
||||
# system_watchdog.sh --dry-run — preview without running anything
|
||||
# system_watchdog.sh --status — show configured scripts and exit
|
||||
# system_watchdog.sh --log — verbose output
|
||||
# ==============================================================================================
|
||||
# RUNTIME MODES
|
||||
# ==============================================================================================
|
||||
#
|
||||
# system_watchdog.sh
|
||||
# Run all system component watchdogs.
|
||||
#
|
||||
# system_watchdog.sh --dry-run
|
||||
# Preview without running anything.
|
||||
#
|
||||
# system_watchdog.sh --status
|
||||
# Show configured scripts and exit.
|
||||
#
|
||||
# system_watchdog.sh --log
|
||||
# Verbose output.
|
||||
#
|
||||
# ==============================================================================================
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
Reference in New Issue
Block a user