Contribute to Cardinal44/corral development by creating an account on GitHub.
There are issues about background processes from the Bash tool not getting cleaned up when the session ends, and one where a timeout sends SIGTERM to the whole process group and ends up killing Claude Code itself. Most runners only kill the process they started, so anything that double forks, runs in the background, or keeps stdout open either survives or makes the runner hang.
Corral was me attempting to make a fix for this problem, while also trying to learn about processes and signals in Linux. You run corral --wall 30s -- yourcommand and by the time it's done, nothing it started should be running.
The command gets its own session so killing it can't kill you, and there's a mode where it runs in its own cgroup so the whole tree gets killed at once, including processes that may have changed sessions or process groups.
If there's no cgroup available it tracks the tree through /proc instead (this is a bit weaker, it still catches processes that changed sessions once their parent dies, but it can't kill anything running as a different user or anything handed off to another service like systemd), and if it can't confirm everything is dead it exits with 120.
Would love any feedback and more stuff along these lines i can do to learn more
4 comments
It's a broad class of bypasses that can apply to just about any "long running daemon can be instructed to spawn a new child" situation.
[1] - https://www.man7.org/linux/man-pages/man1/timeout.1.html
Read the full thread on Hacker News →
Related stories
- Launch HN: Vespper (YC F24) – SOTA Docx MCPvespper.comHacker News · 31 points · 2 days ago
- Hacker News · 3 points · 3 days ago
- Hacker News · 15 points · 13 days ago
- Show HN: Vespper (YC F24) – Docx MCPvespper.comHacker News · 5 points · 3 days ago
- Hacker News · 1 points · 9 days ago
- Hacker News · 1 points · about 2 hours ago