Skip to content

Commit

Permalink
imp: forward signals to child's process group in flux-imp run
Browse files Browse the repository at this point in the history
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 flux-framework#194
  • Loading branch information
grondo committed Nov 6, 2024
1 parent 1bf67ee commit 6702319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/imp/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6702319

Please sign in to comment.