summaryrefslogtreecommitdiffstats
path: root/src/transport/mycelium.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-21 14:34:06 +0200
committertv <tv@krebsco.de>2026-10-21 14:34:06 +0200
commitf85728a72eb756c9e260c6afbdfab961ed414566 (patch)
treeedf6fa169bd1a65f93588acfdfec1716a1fe21e8 /src/transport/mycelium.rs
parent02f9291aeb1b29a5e9349e9eef361431b2a41f12 (diff)
install signal handlers early & handle SIGTERM
Diffstat (limited to 'src/transport/mycelium.rs')
-rw-r--r--src/transport/mycelium.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/transport/mycelium.rs b/src/transport/mycelium.rs
index d31925d..0c816c5 100644
--- a/src/transport/mycelium.rs
+++ b/src/transport/mycelium.rs
@@ -280,6 +280,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 {