From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1301 invoked from network); 6 Dec 2002 10:16:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Dec 2002 10:16:17 -0000 Received: (qmail 18183 invoked by alias); 6 Dec 2002 10:15:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17986 Received: (qmail 18047 invoked from network); 6 Dec 2002 10:15:21 -0000 From: "Bart Schaefer" Message-Id: <1021206101446.ZM10013@candle.brasslantern.com> Date: Fri, 6 Dec 2002 10:14:46 +0000 In-Reply-To: <20021206003013.GA10400@dman.com> Comments: In reply to Clint Adams "GNU nohup oddness" (Dec 5, 7:30pm) References: <20021206003013.GA10400@dman.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Clint Adams , zsh-workers@sunsite.dk Subject: Re: GNU nohup oddness Cc: phil@fifi.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 5, 7:30pm, Clint Adams wrote: } } nohup ./zshscript & } } } } Does anyone know what's going on here? The problem seems to be a combination of three things: (1) The HUP option is set by default. (2) When HUP is set, zsh _explicitly_ sends SIGHUP to process group in its job table on exit, rather than rely on the tty driver to do it when the tty is hung up. (3) In Src/init.c:init_signals(), zsh explicitly installs a SIGHUP handler, even in non-interactive shells. It has done so for a very long time -- as far back as recorded in my CVS of 3.0.x, which means prior to 27-Jun-97. That last one is the real culprit, because it means that jobs started as part of the script inherit the SIG_DFL handler from the #! zsh, rather than inheriting SIG_IGN from the nohup great-grandparent (it's "great-" because `nohup' runs `nice' as the grandparent). So even if the script does `setopt nohup', the top-level shell's process-group kill will hit all the children of the script. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net