diff options
| author | tv <tv@krebsco.de> | 2026-10-21 14:34:06 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-21 14:34:06 +0200 |
| commit | 00f770d985e6ad1294746d4f1c1d72d3d7170d23 (patch) | |
| tree | 53d49479c4514006e7fe3c0284908475a19b9687 /src/transport | |
| parent | 4047c38c5230fd7035f9f60a711a824d63a9636a (diff) | |
install signal handlers early & handle SIGTERM
Diffstat (limited to 'src/transport')
| -rw-r--r-- | src/transport/mycelium.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/transport/mycelium.rs b/src/transport/mycelium.rs index 9147a5d..a8a0e10 100644 --- a/src/transport/mycelium.rs +++ b/src/transport/mycelium.rs @@ -291,6 +291,12 @@ impl SupervisedMycelium { for &fd in &fds_to_inherit { libc::fcntl(fd, libc::F_SETFD, 0); } + // Own process group: a Ctrl-C in the terminal goes to continuum only, + // which then stops Mycelium itself, instead of both exiting at once (which + // shows up as "Mycelium runtime process exited"). + if libc::setpgid(0, 0) != 0 { + return Err(std::io::Error::last_os_error()); + } #[cfg(target_os = "linux")] { if libc::prctl(libc::PR_SET_PDEATHSIG, libc::SIGTERM) != 0 { |
