feat(supervisor): RealChild + spawn_with_logs

Append RealChild (real tokio::process::Child wrapper) and spawn_with_logs
to child.rs. Uses nix::unistd::setpgid via tokio's re-exported pre_exec
to create an own process group, and fires per-stream log pump tasks that
drain stdout/stderr into the provided LogSink. terminate/kill signal the
whole process group via kill(-pgid, SIG*).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 11:40:19 +02:00
co-authored by Claude Sonnet 4.6
parent e121fe28bb
commit f1b2306156
2 changed files with 120 additions and 1 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ pub mod policy;
pub mod retry_window;
pub use backoff::Backoff;
pub use child::{ChildHandle, MockChild, MockChildController};
pub use child::{ChildHandle, MockChild, MockChildController, RealChild, spawn_with_logs};
pub use logs::{LogSink, RecordedLine, RingBuffer, RotatingLogWriter};
pub use policy::{RestartDecision, decide};
pub use retry_window::RetryWindow;