From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21467 invoked by alias); 27 Oct 2012 18:08:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17358 Received: (qmail 11251 invoked from network); 27 Oct 2012 18:07:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <121027110728.ZM8440@torch.brasslantern.com> Date: Sat, 27 Oct 2012 11:07:28 -0700 In-reply-to: Comments: In reply to Alan Pinstein "Re: Commands run from functions don't exit cleanly on terminal close (SIGHUP)?" (Oct 25, 11:10pm) References: <2B813FB0-0877-42BA-974C-1A142EF09BCE@mac.com> <909858C7-4B5A-4679-90B3-6BF5398BA9FC@mac.com> <20121025112222.3dfbb213@pws-pc.ntlworld.com> <121025075455.ZM3417@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Commands run from functions don't exit cleanly on terminal close (SIGHUP)? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii (Alan, your previous message went only to me, not to zsh-users. I'm using the list for this response.) On Oct 25, 11:10pm, Alan Pinstein wrote: } } # on CentOS } Interestingly if I "kill -HUP " while it's running, I get this output: } } Thu Oct 25 22:09:26 CDT 2012 } START } Thu Oct 25 22:09:34 CDT 2012 } DONE } } It doesn't log the HUP for some reason. Which PID are you hupping? The php job, or zsh? On MacOS, I get the above if I HUP php. If I HUP zsh, I get Sat Oct 27 10:47:42 PDT 2012 START Sat Oct 27 10:47:46 PDT 2012 HUP Sat Oct 27 10:47:54 PDT 2012 DONE which is what I'd expect because zsh won't pass the trapped HUP along to it's child processes. If zsh actually exited, it would HUP the children (assuming NO_HUP is not set), but it did not exit, because of the trap. In the case of the window closing, php should get the HUP, because it is the foreground job. Here's a question we haven't asked yet: What version of zsh are you trying this with, in each case (MacOS/CentOS)? I've been testing 5.0, but if I try closing ssh with ~. when using 4.3.11 as shipped with Mountain Lion, I get entirely different behavior; neither HUP nor DONE is written to the file, only START -- but both php and zsh have exited.