From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 24 Apr 2011 19:00:29 -0700 From: Anthony Martin To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20110425020029.GA29551@dinah> References: <86wrijennb.fsf@cmarib.ramside> <20110424171741.D5865B827@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [9fans] Different results for the same rc script when using listen1 Topicbox-Message-UUID: d4392f84-ead6-11e9-9d60-3106f5b1d025 > This is really weird. I don't even know what could I check. 'listen1' > source code is pretty clean, and it calls command and args with a simple > 'exec' call. The only thing that was also unusual is that the 'net' > variable, which is supposed to be set to a directory, is always blank, > but the line with 'putenv' and 'net' in 'listen1.c' is commented out, > so this is to be expected. It fails on my Linux machine also. It's because an rfork with RFNOWAIT sets up a child proc that will ignore SIGCHLD. If the program that is executed (in this case rc) calls fork or exec all SIGCHLD signals will be ignored, see signal(7). Ultimately, this causes rc to set status='' for every process it forks. That's why all those tests are returning true. The solution is probably just reenabling the SIGCHLD handler at /usr/local/plan9/src/lib9/rfork.c:96 after the second fork. Anthony