fix: sudo keepalive cleanup leaking exit code 143

wait on a SIGTERM-killed process returns 143 (128+15).
With set -e active in the setup script, this overrides the
script's exit code, making a successful install appear failed.

Amp-Thread-ID: https://ampcode.com/threads/T-019c93b6-b135-743f-8844-6a1ca8875506
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
GokuPlay609
2026-02-25 13:16:46 +05:30
parent 8bf279e571
commit 9a3bb5e59e
+2 -2
View File
@@ -119,8 +119,8 @@ function sudo_init_keepalive(){
# Stop the sudo keepalive background process
function sudo_stop_keepalive(){
if [[ -n "$SUDO_KEEPALIVE_PID" ]] && kill -0 "$SUDO_KEEPALIVE_PID" 2>/dev/null; then
kill "$SUDO_KEEPALIVE_PID" 2>/dev/null
wait "$SUDO_KEEPALIVE_PID" 2>/dev/null
kill "$SUDO_KEEPALIVE_PID" 2>/dev/null || true
wait "$SUDO_KEEPALIVE_PID" 2>/dev/null || true
SUDO_KEEPALIVE_PID=""
fi
}