Release v0.51.304 — Release JT (stage-p2a — un-held terminal reaper + opt-in Docker GPU) (#3757)

* fix(terminal): reap reparented terminal descendants by process group (#3725, #2577)

Embedded-terminal descendants reparented to the WebUI process could linger as
zombies. The reaper now calls os.waitpid(-terminal_pgid, WNOHANG) scoped to the
terminal's own process group (terminals spawn with start_new_session=True, so
proc.pid == pgid) rather than process-wide waitpid(-1), which would otherwise
reap unrelated WebUI subprocess children and silently coerce their exit codes to
0. Bounded by a 64-iteration limit and lock-guarded. Runs on reader cleanup and
terminal close.

Co-authored-by: rodboev <rodboev@users.noreply.github.com>

* docs(docker): add opt-in GPU runtime image path (#3721, #3243)

The default image stays CPU-only. A new INSTALL_GPU_LIBS=1 build arg installs
VA-API user-space libraries for users passing through host GPU devices, and
docker_init.bash preserves Docker --group-add supplemental groups (e.g. render/
video for /dev/dri) when dropping privileges to the runtime user. Default
(INSTALL_GPU_LIBS=0) is a no-op. Docs + regression test included.

Co-authored-by: rodboev <rodboev@users.noreply.github.com>

* docs(changelog): stamp v0.51.304 — Release JT (stage-p2a #3725 #3721)

---------

Co-authored-by: nesquena-hermes <[email protected]>
Co-authored-by: rodboev <rodboev@users.noreply.github.com>
This commit is contained in:
nesquena-hermes
2026-06-06 18:04:16 -07:00
committed by GitHub
parent 4580f58496
commit 3a8a51e507
7 changed files with 376 additions and 0 deletions
+23
View File
@@ -264,6 +264,29 @@ if [ "A${whoami}" == "Aroot" ]; then
chmod 600 "$ENV_FILE" || error_exit "Failed to secure $ENV_FILE"
export _HW_ROOT_ENV_PATH="$ENV_FILE"
# Preserve Docker --group-add supplemental groups (for example render/video
# for /dev/dri GPU access) when dropping privileges. `su` rebuilds the target
# user's groups from /etc/group, so host-passed numeric groups must be made
# visible to hermeswebui before re-entering as the runtime user.
for gid in $(id -G); do
if [ "$gid" = "0" ] || [ "$gid" = "$WANTED_GID" ]; then
continue
fi
group_name="$(getent group "$gid" | cut -d: -f1 || true)"
if [ -z "$group_name" ]; then
group_name="hostgpu${gid}"
groupadd -g "$gid" "$group_name" 2>/dev/null || true
group_name="$(getent group "$gid" | cut -d: -f1 || true)"
fi
if [ -z "$group_name" ]; then
echo "!! WARNING: Could not create supplemental group for GID $gid; GPU device access may be unavailable"
continue
fi
if [ -n "$group_name" ]; then
usermod -a -G "$group_name" hermeswebui 2>/dev/null || echo "!! WARNING: Could not add hermeswebui to supplemental group $group_name ($gid)"
fi
done
# restart the script as hermeswebui set with the correct UID/GID this time
echo "-- Restarting as hermeswebui user with UID ${WANTED_UID} GID ${WANTED_GID}"
exec su -s /bin/bash -c "exec \"${script_fullname}\"" hermeswebui || error_exit "subscript failed"