mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-05 01:27:28 +00:00
[PR #48] [CLOSED] fix: reap zombie processes via tini PID 1 and os.killpg() for process groups #115
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/open-terminal#115
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-terminal/pull/48
Author: @kb5000
Created: 3/11/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (1)
d7787cefix: reap zombie processes via tini PID 1 and os.killpg() for process groups📊 Changes
3 files changed (+16 additions, -8 deletions)
View changed files
📝
Dockerfile(+2 -2)📝
open_terminal/main.py(+9 -2)📝
open_terminal/utils/runner.py(+5 -4)📄 Description
Problem
When running in Docker, two related zombie/orphan process issues exist:
No init process:
entrypoint.shusesexec open-terminal "$@", whichmakes the Python/uvicorn process run directly as PID 1. Python has no
SIGCHLDhandler to reap orphaned grandchildren (e.g. processes spawnedinside a terminal session that then loses its parent). These accumulate as
zombie processes indefinitely.
Incomplete process group cleanup:
_cleanup_sessionandPtyRunner.kill()sent signals only to the direct shell PID, not to theentire process group. Background processes started inside a terminal session
(e.g.
sleep 100 &) were left running as orphans. Additionally,_cleanup_sessioncalledprocess.kill()but never calledprocess.wait()afterwards, so the kernel kept the PCB in zombie state
Z.Fix
Dockerfile— addtinias PID 1:Testing
Built the Docker image and verified with a smoke test:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.