From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11686 invoked by alias); 25 Oct 2012 13:22:49 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30754 Received: (qmail 10656 invoked from network); 25 Oct 2012 13:22:44 -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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at mac.com designates 17.158.236.240 as permitted sender) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.431,0.0.0000 definitions=2012-10-25_01:2012-10-24,2012-10-25,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1210250133 Subject: Re: Commands run from functions don't exit cleanly on terminal close (SIGHUP)? From: Alan Pinstein In-reply-to: Date: Thu, 25 Oct 2012 09:22:24 -0400 Message-id: References: <2B813FB0-0877-42BA-974C-1A142EF09BCE@mac.com> <909858C7-4B5A-4679-90B3-6BF5398BA9FC@mac.com> <20121025112222.3dfbb213@pws-pc.ntlworld.com> To: "zsh-workers@zsh.org" X-Mailer: Apple Mail (2.1283) I tried from CentOS but got the same thing. However it might be confounded by the fact that I have to SSH to the centos box... Just to clarify, you're seeing it exit *before* the loop finishes? This is what I see in the "sig" file: Thu Oct 25 08:20:05 CDT 2012 START Thu Oct 25 08:20:26 CDT 2012 HUP Thu Oct 25 08:20:36 CDT 2012 DONE The HUP is received but doesn't affect the process until the php command exits. So you're just seeing this? Thu Oct 25 08:20:05 CDT 2012 START Thu Oct 25 08:20:26 CDT 2012 HUP Alan On Oct 25, 2012, at 7:48 AM, Alan Pinstein wrote: > I didn't even think about it being platform dependent. I am on Mac OS 10.7.5. I will try to test on a centos box today. > > Alan > > On Oct 25, 2012, at 6:22 AM, Peter Stephenson wrote: > >> On Wed, 24 Oct 2012 10:10:42 -0400 >> Alan Pinstein wrote: >>> I need to make one clarification; the PPID ends up as 1 (orphaned) if >>> no traps are installed; if the HUP trap is installed, the PPID remains >>> correct, but it still doesn't exit. >> >> In my case (Fedora 15 on x86_64), I'm seeing the programme exit if there >> aren't any traps, so I've got different behaviour. This could be as the >> result of a race or indeed pretty much anything else... >> >> With the HUP trap, it's not exiting, but that doesn't actually surprise >> me: you're handling the trap within the shell, so it's not being >> propagated as a signal to PHP. >> >> There are lots of variables, I'll try to experiment some more, in >> particular finding differences between the behaviour in functions and >> not (which wouldn't surprise me, there is some special handling). >> >> pws