Wire up unused config vars found in follow-up audit pass

TRANSCODE_LOG_RETENTION was documented as trimming the daily transcode log
but never referenced — log grew unbounded. TRANSCODE_ORPHAN_AGE was shown in
--status but never used, so empty session folders were deleted immediately
instead of after the documented grace period, risking a race against ffmpeg
creating a folder just before writing its first segment.

docker_watchdog.sh's daemon-health thresholds were only hardcoded fallbacks
despite comments claiming they were master.conf-configurable, and it
referenced a heartbeat feature that was never implemented (that's owned by
watchdog_orchestrator.sh, its caller) — added the three thresholds to
master.conf for real and removed the stale heartbeat claim.

Also added the missing HOSTN_PARTNERSHIP_SERVICES_STACK block to
host.conf.template (containers.sh already read it via detect_hosts, just
never had a template entry) and corrected play_state_sync.sh's doc comment
for PLAY_SYNC_TYPES' actual default.
This commit is contained in:
Gmer4Lfe
2026-07-03 17:45:20 -04:00
parent 69189bbf18
commit 260f0a61ce
7 changed files with 34 additions and 7 deletions
+5
View File
@@ -813,6 +813,11 @@
# Notification batching — one summary per cycle instead of one ping per event
WATCHDOG_BATCH_NOTIFY=true
# Docker daemon health check — hung daemon detection at the start of each cycle
WATCHDOG_DAEMON_TIMEOUT=20 # seconds — timeout for all docker commands
WATCHDOG_DAEMON_STRIKE_LIMIT=3 # consecutive failed checks before restart attempt
WATCHDOG_DAEMON_RESTART_WAIT=900 # seconds to wait after restart before verifying
# Appdata size monitoring — two-part catch-all for runaway growth and oversized log files.
#
# Part 1 — Growth rate (zero-config):
+5
View File
@@ -151,6 +151,11 @@
# "my-Radarr.xml"
)
# XML templates pushed to mirror during onboard — other services (not auth, not arr).
HOSTN_PARTNERSHIP_SERVICES_STACK=(
# "my-Lidarr.xml"
)
# Paths the partner should collect during the grace window after offboard.
HOSTN_PARTNERSHIP_MIRROR_BACKUPS=(
# "/mnt/user/appdata-Fallback/Partner-Emby"
+5
View File
@@ -808,6 +808,11 @@
# Notification batching — one summary per cycle instead of one ping per event
WATCHDOG_BATCH_NOTIFY=true
# Docker daemon health check — hung daemon detection at the start of each cycle
WATCHDOG_DAEMON_TIMEOUT=20 # seconds — timeout for all docker commands
WATCHDOG_DAEMON_STRIKE_LIMIT=3 # consecutive failed checks before restart attempt
WATCHDOG_DAEMON_RESTART_WAIT=900 # seconds to wait after restart before verifying
# Appdata size monitoring — two-part catch-all for runaway growth and oversized log files.
#
# Part 1 — Growth rate (zero-config):
+2 -1
View File
@@ -79,7 +79,8 @@
# false = local servers only (this host's Emby + Jellyfin)
# PLAY_SYNC_DAYS How many days back to check for played items (default: 90)
# Use 0 to sync all played items (slow on large libraries).
# PLAY_SYNC_TYPES Comma-separated item types to sync (default: Movie,Episode,Audio)
# PLAY_SYNC_TYPES Comma-separated item types to sync (default: Movie,Episode
# Audio excluded, music library too large; favorites handled separately)
#
# ==============================================================================================
# RUNTIME MODES
+4 -3
View File
@@ -230,10 +230,11 @@ cleanup_location() {
done < <(find "$location" -type f -mmin +"$max_age" 2>/dev/null)
# Remove empty directories — but NEVER remove transcoding-temp
# transcoding-temp must always exist on ramdisk so Emby finds it there first
# Remove empty directories older than TRANSCODE_ORPHAN_AGE — but NEVER remove
# transcoding-temp. Age gate avoids deleting a session folder ffmpeg just
# created but hasn't written its first segment into yet.
if [[ "$DRY_RUN" == false ]]; then
find "$location" -mindepth 1 -type d -empty \
find "$location" -mindepth 1 -type d -empty -mmin +"${TRANSCODE_ORPHAN_AGE:-30}" \
! -name "transcoding-temp" -delete 2>/dev/null
fi
+8
View File
@@ -647,6 +647,14 @@ if [[ "$DRY_RUN" == false && "$NO_LOG" == false && -n "${TRANSCODE_DAILY_LOG:-}"
echo "${TODAY}|${RAMDISK_USED_GB}|${FLIP_COUNT}|${RAM_SESSION_COUNT}|${SSD_SESSION_COUNT}" \
>> "$TRANSCODE_DAILY_LOG" 2>/dev/null || true
log "Daily log written: $TRANSCODE_DAILY_LOG"
# Trim entries older than TRANSCODE_LOG_RETENTION days
LOG_CUTOFF=$(date -d "${TRANSCODE_LOG_RETENTION:-90} days ago" '+%Y-%m-%d' 2>/dev/null)
if [[ -n "$LOG_CUTOFF" ]]; then
awk -F'|' -v cutoff="$LOG_CUTOFF" '$1 >= cutoff' "$TRANSCODE_DAILY_LOG" \
> "${TRANSCODE_DAILY_LOG}.tmp" 2>/dev/null && \
mv "${TRANSCODE_DAILY_LOG}.tmp" "$TRANSCODE_DAILY_LOG"
fi
fi
# ==============================================================================================
+5 -3
View File
@@ -82,7 +82,8 @@
#
# Silent When Healthy
# Runs 96 times per day. Producing output on every clean cycle would make
# logs useless. Output only when something needs attention or a heartbeat fires.
# logs useless. Output only when something needs attention — alive heartbeat
# is handled by watchdog_orchestrator.sh, the caller, not this script.
#
# ==============================================================================================
# OPERATIONAL SAFEGUARDS
@@ -196,8 +197,9 @@
# WATCHDOG_BATCH_NOTIFY
# Collect cycle events and send as one notification (default: true)
#
# DOCKER_WATCHDOG_HEARTBEAT_HOURS
# Hours between alive heartbeat log entries
# WATCHDOG_DAEMON_TIMEOUT / WATCHDOG_DAEMON_STRIKE_LIMIT / WATCHDOG_DAEMON_RESTART_WAIT
# Docker daemon health check: command timeout, strikes before restart attempt,
# seconds to wait after restart before verifying
#
# DOCKER_WATCHDOG_INTENTIONAL_FILE
# Path to intentional stops state file (STATE_DIR). Containers in this file