NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: "set -m" stalls shell when run in a new process group

In article <>,
Julio Merino  <> wrote:
>I am not sure what the right behavior is here, but I am seeing this with 
>/bin/sh and /bin/ksh but not bash.
>I have a program (atf) that spawns a child process and sets the child 
>process to run in its own process group.  This child process spawns a 
>shell and the shell script that it runs does "set -m".
>At this point, the shell blocks.  In the case of /bin/sh, the block 
>happens at the "killpg(0, SIGTTIN);" line.

It means that the shell lacks access to the tty in order to be able to
do job control, so it stops itself. Typical the shell figures out if
it can do job control automatically, and if it can't it does not, but
you are forcing it to with -m.

>What is the expected behavior of this?  Are sh and ksh correct in 
>stalling, or is bash?  Is this a bug?  (If the latter, I'll be glad to 
>file a PR and add a test case.)

Bash as usual tries to be "helpful".


Home | Main Index | Thread Index | Old Index