Header/code audit fixes across all core scripts
Behavior fixes: - docker_daily_restart.sh: implement RESTART_VERIFY_WAIT sleep before verify_running() — variable was logged as config but never applied - cert_monitor.sh: --log now shows expiry date and days remaining for healthy domains in the per-domain summary; problems always show details Header corrections: - downloaders_reset.sh: fix frequency contradiction (15 min → 30 min) - lidarr_cleanup.sh: Emby scan triggers on actual deletions, not every run - ssh_setup.sh: document --local-only flag in USAGE section - zfs_memory_snapshot.sh: clarify dry-run skips log write in PURPOSE - ramdisk_stop.sh / ramdisk_setup.sh: document TRANSCODE_STATE_FILE var - smart_long_test.sh: remove SMART_TEMP_WARN/CRIT — not used in code
This commit is contained in:
@@ -82,6 +82,11 @@
|
|||||||
# CONTAINER_DELAY
|
# CONTAINER_DELAY
|
||||||
# Seconds to wait after restarting a dependency before starting its dependents
|
# Seconds to wait after restarting a dependency before starting its dependents
|
||||||
#
|
#
|
||||||
|
# RESTART_VERIFY_WAIT
|
||||||
|
# Seconds to wait after docker restart before checking the container is running.
|
||||||
|
# Gives the process time to initialise before verify_running samples the state.
|
||||||
|
# (default: 3)
|
||||||
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# RUNTIME MODES
|
# RUNTIME MODES
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
@@ -266,7 +271,7 @@ for container in "${ORDERED_RESTART[@]}"; do
|
|||||||
RESTARTED+=("$container")
|
RESTARTED+=("$container")
|
||||||
else
|
else
|
||||||
if retry_docker docker restart "$container"; then
|
if retry_docker docker restart "$container"; then
|
||||||
# Verify container stayed running after restart
|
[[ "${RESTART_VERIFY_WAIT:-3}" -gt 0 ]] && sleep "${RESTART_VERIFY_WAIT:-3}"
|
||||||
if verify_running "$container"; then
|
if verify_running "$container"; then
|
||||||
log "$ICON_STARTED $container restarted and running in $(format_duration $(( $(date +%s) - c_start ))) ✅"
|
log "$ICON_STARTED $container restarted and running in $(format_duration $(( $(date +%s) - c_start ))) ✅"
|
||||||
RESTARTED+=("$container")
|
RESTARTED+=("$container")
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
#
|
#
|
||||||
# Lock Acquisition
|
# Lock Acquisition
|
||||||
# acquire_lock "wait" — waits for previous run to finish since this runs every
|
# acquire_lock "wait" — waits for previous run to finish since this runs every
|
||||||
# 15 minutes and prior execution may still be completing.
|
# 30 minutes and prior execution may still be completing.
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# Delete orphaned music files not tracked by Lidarr. Queries the API for all
|
# Delete orphaned music files not tracked by Lidarr. Queries the API for all
|
||||||
# tracked file paths, walks the library on disk, and removes anything untracked
|
# tracked file paths, walks the library on disk, and removes anything untracked
|
||||||
# that is old enough to be past the import window. Triggers an Emby library
|
# that is old enough to be past the import window. Triggers an Emby library
|
||||||
# clean after each deletion run so ghost entries disappear immediately.
|
# clean after runs where files were deleted so ghost entries disappear immediately.
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# OPERATIONAL MODEL
|
# OPERATIONAL MODEL
|
||||||
|
|||||||
@@ -83,7 +83,8 @@
|
|||||||
# Show domain list, warning thresholds, and timeout. Then exit.
|
# Show domain list, warning thresholds, and timeout. Then exit.
|
||||||
#
|
#
|
||||||
# cert_monitor.sh --log
|
# cert_monitor.sh --log
|
||||||
# Verbose per-domain output during the run.
|
# Include healthy domains in per-domain output with expiry date and days remaining.
|
||||||
|
# Problems (WARN/CRIT/FAIL) always show with their details regardless of this flag.
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|
||||||
@@ -259,13 +260,14 @@ echo " $ICON_SUCCESS Healthy: ${#HEALTHY[@]}"
|
|||||||
[[ ${#FAILED[@]} -gt 0 ]] && echo "$ICON_ERROR Failed: ${#FAILED[@]} — unreachable"
|
[[ ${#FAILED[@]} -gt 0 ]] && echo "$ICON_ERROR Failed: ${#FAILED[@]} — unreachable"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Per-domain results — only show problems, healthy ones stay in log()
|
# Per-domain results — problems always shown with days remaining; healthy only with --log
|
||||||
for domain in "${CERT_MONITOR_DOMAINS[@]}"; do
|
for domain in "${CERT_MONITOR_DOMAINS[@]}"; do
|
||||||
[[ -z "$domain" ]] && continue
|
[[ -z "$domain" ]] && continue
|
||||||
|
local _days="${DOMAIN_DAYS[$domain]:-?}" _exp="${DOMAIN_EXPIRY[$domain]:-unknown}"
|
||||||
case "${DOMAIN_STATUS[$domain]:-UNKN}" in
|
case "${DOMAIN_STATUS[$domain]:-UNKN}" in
|
||||||
OK) log " $ICON_SUCCESS $domain — healthy" ;;
|
OK) log " $ICON_SUCCESS $domain — healthy (${_days}d, expires ${_exp})" ;;
|
||||||
WARN) warn " $ICON_WARN $domain — warning" ;;
|
WARN) warn " $ICON_WARN $domain — warning (${_days}d, expires ${_exp})" ;;
|
||||||
CRIT) echo " $ICON_ERROR $domain — CRITICAL" ;;
|
CRIT) echo " $ICON_ERROR $domain — CRITICAL (${_days}d, expires ${_exp})" ;;
|
||||||
FAIL) echo " $ICON_ERROR $domain — unreachable" ;;
|
FAIL) echo " $ICON_ERROR $domain — unreachable" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
# only — system_watchdog.sh handles threshold-based intervention.
|
# only — system_watchdog.sh handles threshold-based intervention.
|
||||||
#
|
#
|
||||||
# Combines ZFS pool status, ARC statistics, Docker memory usage, and kernel
|
# Combines ZFS pool status, ARC statistics, Docker memory usage, and kernel
|
||||||
# memory pressure into a single snapshot. Output goes to both console (for User
|
# memory pressure into a single snapshot. In normal mode output goes to both
|
||||||
# Scripts output log) and ZFS_REPORT_LOG for week-over-week comparison.
|
# console (for User Scripts output log) and ZFS_REPORT_LOG for week-over-week
|
||||||
|
# comparison. In --dry-run mode, console only — nothing written to the log.
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# OPERATIONAL MODEL
|
# OPERATIONAL MODEL
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
# Partnership/ssh_setup.sh --force — regenerate + re-copy
|
# Partnership/ssh_setup.sh --force — regenerate + re-copy
|
||||||
# Partnership/ssh_setup.sh --validate — health check + strike tracking
|
# Partnership/ssh_setup.sh --validate — health check + strike tracking
|
||||||
# Partnership/ssh_setup.sh --status — show key and connectivity state
|
# Partnership/ssh_setup.sh --status — show key and connectivity state
|
||||||
|
# Partnership/ssh_setup.sh --local-only — generate key locally, skip remote copy
|
||||||
# Any mode supports --dry-run and --log
|
# Any mode supports --dry-run and --log
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
# master.conf
|
# master.conf
|
||||||
# TRANSCODE_LINK Symlink Emby uses. Must match Emby's transcode path setting.
|
# TRANSCODE_LINK Symlink Emby uses. Must match Emby's transcode path setting.
|
||||||
# RAMDISK_PATH tmpfs mount point.
|
# RAMDISK_PATH tmpfs mount point.
|
||||||
|
# TRANSCODE_STATE_FILE Override state file path (default: ${STATE_DIR}/transcode_state.db).
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# STATE FILES
|
# STATE FILES
|
||||||
|
|||||||
@@ -61,10 +61,6 @@
|
|||||||
#
|
#
|
||||||
# master.conf
|
# master.conf
|
||||||
#
|
#
|
||||||
# SMART_TEMP_WARN / SMART_TEMP_CRIT
|
|
||||||
# Fallback thresholds used for post-test temperature reporting if
|
|
||||||
# dynamix.cfg is not found.
|
|
||||||
#
|
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# RUNTIME MODES
|
# RUNTIME MODES
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|||||||
@@ -78,12 +78,16 @@
|
|||||||
# TRANSCODE_CHMOD / TRANSCODE_OWNER
|
# TRANSCODE_CHMOD / TRANSCODE_OWNER
|
||||||
# Permissions applied to both ramdisk and SSD directories. (default: 755 / nobody:users)
|
# Permissions applied to both ramdisk and SSD directories. (default: 755 / nobody:users)
|
||||||
#
|
#
|
||||||
|
# TRANSCODE_STATE_FILE
|
||||||
|
# Override state file path. (default: ${STATE_DIR}/transcode_state.db)
|
||||||
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# STATE FILES
|
# STATE FILES
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
#
|
#
|
||||||
# /tmp/transcode_state.db — current symlink target + flip count tracking
|
# TRANSCODE_STATE_FILE (default: ${STATE_DIR}/transcode_state.db)
|
||||||
# Lives in /tmp (ephemeral — resets on reboot correctly)
|
# Current symlink target + flip count tracking. Lives in STATE_DIR
|
||||||
|
# (ephemeral on Unraid — resets on reboot correctly).
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# RUNTIME MODES
|
# RUNTIME MODES
|
||||||
|
|||||||
Reference in New Issue
Block a user