From 67023196c29efed389faab75845ca1f9fa8e7873 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Wed, 6 Nov 2024 14:50:25 +0000 Subject: [PATCH] imp: forward signals to child's process group in `flux-imp run` Problem: `flux-imp run` only forwards signals to its direct child. When that child is a shell script running other processes, common signals like SIGINT and SIGTERM are blocked. Even if the direct child is not a shell, terminating only the IMP's child may leave stray procesess which do not immediately exit as desired. Deliver forwarded signals to the child's process group. Fixes #194 --- src/imp/run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imp/run.c b/src/imp/run.c index 4b6725a..32e1059 100644 --- a/src/imp/run.c +++ b/src/imp/run.c @@ -193,7 +193,7 @@ imp_run (struct imp_state *imp, if ((child = fork ()) < 0) imp_die (1, "run: fork: %s", strerror (errno)); - imp_set_signal_child (child); + imp_set_signal_child (-child); if (child == 0) { /* unblock all signals */