From 30f399a0f8a9f87ddf96c60a0b5c6d947d9a98f1 Mon Sep 17 00:00:00 2001 From: spydisec <9101327+spydisec@users.noreply.github.com> Date: Thu, 12 Nov 2026 00:47:03 +0000 Subject: [PATCH] fix: don't hang a piped guided install under sudo-rs 0.5.3 made a failed terminal read a refusal. That covers sudo-rs 0.2.8 on Ubuntu 25.10, where the read fails. Under sudo-rs 0.2.13 on Ubuntu 26.04 the read doesn't fail. The script runs in the background of the terminal, so the kernel stops it when it reads the keyboard, and the install hangs. install.sh now ignores that stop signal when sudo is sudo-rs. The read then fails, and the script refuses with terminal_read and the hint. The classic sudo moves a stopped script to the foreground, so the signal is left alone there, and the piped form keeps working. Tested through a terminal in containers. Ubuntu 26.04 and 25.10 refuse the piped form with the hint and install with sudo sh -c. Ubuntu 24.04, Debian 13 and AlmaLinux 9 install with both forms. Co-Authored-By: Claude Fable 5.2 --- scripts/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 124aa0f..15db7bc 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -122,6 +122,13 @@ install_write_settings() { # and taking it as "no" would cancel the install before the user could type. install_ask() { printf '%s ' "$1" >/dev/tty + # sudo-rs, e.g. on Ubuntu 26.04, runs a piped script in the background of the terminal, and + # the kernel then stops a process that reads the keyboard, so the install would hang. With + # the stop signal ignored the read fails, and the script can say why. The classic sudo moves + # the script to the foreground when it is stopped, so the signal is left alone there. + case "$(sudo -V 2>/dev/null | sed -n 1p)" in + *sudo-rs*) trap '' TTIN ;; + esac if ! IFS= read -r install_ans /dev/tty echo "refuse=terminal_read detail=can't read your answer from the terminal, so nothing changed. Don't pipe the script into sudo. Run it from a file, or pass the settings as flags without --guided"