Re: FEATURE REQUEST : shell option to automatically terminate child processes on parent death
Date:
Sun, 12 Nov 2023 08:36:45 +0300
On Saturday, November 11, 2023, Corto Beau <corto.beau@laposte.net> wrote:
> Do you mean something like a "fork_noreparent" builtin that would call
> make_child and set PDEATHSIG afterwards, or a "noreparent" builtin that the
> child would have to call ?
>
I don't have a preference for either. I oppose it being a shell option
because first, it's a single function call that works on only one target
platform; and second, its effect doesn't seem to stick. If I'm not missing
anything, if I enable the proposed noreparent option in a shell and run a
command, and that command forks, its children won't receive the death
signal when the shell dies. It doesn't make any sense.
Unless there is a way to make it stick and affect all descendants of the
shell process, I don't think this would be very useful as a loadable
builtin either.
--
Oğuz