Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Commands run from functions don't exit cleanly on terminal close (SIGHUP)?



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 <p.w.stephenson@xxxxxxxxxxxx> wrote:
> 
>> On Wed, 24 Oct 2012 10:10:42 -0400
>> Alan Pinstein <apinstein@xxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author