Improve container build/install logging and error handling

Introduces distinct BUILD_LOG and INSTALL_LOG variables for host and container operations, ensuring logs are properly captured and retrievable. Refactors silent execution and error handling to use the active log file, improves log copying after failures, and enhances context detection for log management. Also adds fallback logic for INSTALL_LOG initialization in install.func.
This commit is contained in:
CanbiZ
2025-11-17 12:45:24 +01:00
parent 06a4091019
commit c2b7f4e298
4 changed files with 81 additions and 27 deletions

View File

@@ -28,6 +28,11 @@
# SECTION 1: INITIALIZATION
# ==============================================================================
# Ensure INSTALL_LOG is set (exported from build.func, but fallback if missing)
if [[ -z "${INSTALL_LOG:-}" ]]; then
INSTALL_LOG="/root/.install-${SESSION_ID:-unknown}.log"
fi
if ! command -v curl >/dev/null 2>&1; then
printf "\r\e[2K%b" '\033[93m Setup Source \033[m' >&2
apt-get update >/dev/null 2>&1