Simplify lxc-attach logging and terminal handling

Remove host-side tee capture of lxc-attach output and PIPESTATUS handling; lxc-attach is now invoked directly and the exit code is taken from $?. Simplify install log retrieval by pulling /root/.install-<SESSION_ID>.log directly and removing the fallback that used the host-captured terminal log, related temp-file size checks, and timeout logic. Remove terminal-state restores and input-draining (stty/dd) and stop redirecting reads from /dev/tty so interactive reads use standard input; similar simplifications applied to the retry flow. Also remove cleanup of the discarded capture log. These changes reduce complexity and terminal manipulation, at the cost of losing the previous terminal-capture fallback for installs that failed to produce a container-side log.
This commit is contained in:
CanbiZ (MickLesk)
2026-03-02 10:46:25 +01:00
parent 750b904abc
commit 9f15ca6242
2 changed files with 10 additions and 63 deletions

View File

@@ -286,12 +286,9 @@ error_handler() {
echo -en "${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}"
fi
# Reset terminal state and flush stale input from buffer
stty sane 2>/dev/null || true
dd iflag=nonblock if=/dev/tty of=/dev/null 2>/dev/null || true
sleep 0.3
# Read user response
local response=""
if read -t 60 -r response </dev/tty; then
if read -t 60 -r response; then
if [[ -z "$response" || "$response" =~ ^[Yy]$ ]]; then
echo ""
if declare -f msg_info >/dev/null 2>&1; then