fix(mesh/reticulum): kill whole daemon process group on drop #67

Closed
lfg2025 wants to merge 0 commits from fix/reticulum-daemon-process-group into main
Owner

Fixes the reticulum daemon pile-up: the PyInstaller one-file bootstrap forks a child that start_kill only orphans, leaving the RNode serial port jammed across 30-min RX-stall reconnects (9 instances observed live). Spawn the daemon as its own process-group leader and signal the whole group (SIGTERM then SIGKILL) on drop.

Verified: cargo check + reticulum unit tests pass.

Fixes the reticulum daemon pile-up: the PyInstaller one-file bootstrap forks a child that start_kill only orphans, leaving the RNode serial port jammed across 30-min RX-stall reconnects (9 instances observed live). Spawn the daemon as its own process-group leader and signal the whole group (SIGTERM then SIGKILL) on drop. Verified: cargo check + reticulum unit tests pass.
lfg2025 added 1 commit 2026-07-01 20:35:17 +00:00
The reticulum daemon is a PyInstaller one-file binary: a bootloader parent
that forks the real Python process. `kill_on_drop`/`start_kill()` only SIGKILL
the bootloader, orphaning the forked child — which keeps holding the RNode
serial port. Across the listener's 30-min RX-stall reconnects this piled up
(observed 9 concurrent instances on a live node) all clutching /dev/ttyUSB0,
garbling the RNode so it stopped transmitting entirely.

Spawn the daemon as its own process-group leader (`process_group(0)`) and, on
drop, signal the whole group (SIGTERM for a clean RNode/socket release, then
SIGKILL as a hard backstop) so the forked child can never be orphaned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lfg2025 closed this pull request 2026-07-02 08:05:03 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lfg2025/archy#67
No description provided.