Re: Issues with job control and nested shell processes

Message ID
Sender timestamp
DKIM signature
Download raw message
On Wednesday, June 5, 2019 9:14 PM, Drew DeVault <sir@cmpwn.com> wrote:
> On Wed Jun 5, 2019 at 6:12 PM Simon Ser wrote:
> > Hmm. So, I'm not sure whether this is an optimization that dash
> > implements or whether this is really required by the spec.
> Well, I would assume that if I did this:
> some-task &
> kill $!
> That the signal would be delivered to some-task, not to a mrsh process.

The signal will be delivered to the mrsh process group. The child
processes are part of the same process group. mrsh will ignore the
signal, but child processes still receive it.

> > Basically, the issue is that the `&` is represented very high in the
> > POSIX shell AST. So the job that needs to be run may actually need that
> > extra shell process, for instance if the asynchronous command contains
> > `&&` or `|`:
> dash doesn't spawn a subshell in these cases, either :<

It does seem to do it like mrsh:

$ sleep 999 && sleep 999 &

> pstree -a 20447
      └─sleep 9999