sh script hangs after first external command

Fred Buck rogol at marob.MASA.COM
Tue Mar 7 03:06:07 AEST 1989


In article <3642 at datapg.MN.ORG> sewilco at DataPg.MN.ORG (Scot E Wilcoxon) writes:
>A program is doing a system(3) call to execute a shell script.
>The script hangs after doing the first command which is not a shell
>builtin.  Any ideas what can do that?
>
>This problem is taking place in a System V.2 Honeywell-Bull XPS-100

A shell that doesn't get the expected results from SIGCLD will hang
after the first external command, since it can't tell when the child
exits.  Typically this is caused by ignoring SIGCLD before forking the
child.  Try a signal(SIGCLD,SIG_DFL) before your system() call.  If this
fixes the problem, then make provisions to save the previous vector
for SIGCLD and to restore it after system() returns.

------------------------------------------------------------------
Fred Buck       { uunet, rutgers }!hombre!marob!rogol
                { uunet, rutgers }!hombre!magpie!lemur!rogol
                { uunet, rutgers }!rogol at marob.masa.com
------------------------------------------------------------------



More information about the Comp.unix.questions mailing list