unRAID_Essentials echo/log audit pass + exit traps

Exit traps: resource_watchdog registers/clears trap for stopped containers;
server_reboot registers trap to restart Docker service on abort; system_watchdog
records containers before bulk stop and registers trap to restart if reboot aborts.

echo/log audit: status conclusions, nothing-to-do, and clean-cycle confirmations
→ echo across clear_logs, docker_syslog_filter, mover_stop, php_fpm_max_children,
rsync_stop, user_scripts_stop. resource_watchdog: disabled flag, restore-level
messages, pressure status → echo. system_watchdog: clean-cycle summary → echo.
Manual-Unraid_Essentials.md: added Output Tiers section.
This commit is contained in:
Gmer4Lfe
2026-05-21 17:21:20 -04:00
parent 86b31256ed
commit 3770bf80e7
10 changed files with 78 additions and 20 deletions
+11
View File
@@ -121,6 +121,15 @@ acquire_lock
detect_hosts
# ── Exit Trap — restart Docker service if reboot sequence aborts after stopping it ────────────
_REBOOT_DOCKER_STOPPED=false
_trap_restart_docker_service() {
[[ "$_REBOOT_DOCKER_STOPPED" == true ]] || return
warn "Exit trap: restarting Docker service after aborted reboot sequence"
/etc/rc.d/rc.docker start >/dev/null 2>&1 || true
}
trap _trap_restart_docker_service EXIT
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made, no reboot will occur"
# ==============================================================================================
@@ -280,6 +289,7 @@ if [[ "$DRY_RUN" == true ]]; then
warn "DRY RUN — would stop Docker service"
else
if /etc/rc.d/rc.docker stop >/dev/null 2>&1; then
_REBOOT_DOCKER_STOPPED=true
warn "Docker stopped ✅"
else
warn "Docker stop returned non-zero — may already be stopped"
@@ -317,5 +327,6 @@ if [[ "$DRY_RUN" == true ]]; then
else
warn "$ICON_REBOOT Rebooting $MY_ID now..."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
trap - EXIT # committed to reboot — Docker should stay down
/sbin/reboot
fi