Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!cmcl2!phri!marob!rogol From: rogol@marob.MASA.COM (Fred Buck) Newsgroups: comp.unix.questions Subject: Re: sh script hangs after first external command Message-ID: <578@marob.MASA.COM> Date: 6 Mar 89 17:06:07 GMT References: <3642@datapg.MN.ORG> Reply-To: rogol@marob.masa.com (Fred Buck) Distribution: na Organization: Today Organization, Tomorrow Chaos Lines: 19 In article <3642@datapg.MN.ORG> sewilco@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@marob.masa.com ------------------------------------------------------------------