James Gray
12/8/2007 2:49:00 AM
On Dec 7, 2007, at 7:26 PM, ara.t.howard wrote:
>
> On Dec 7, 2007, at 1:33 PM, James Gray wrote:
>
>> I'm not saying this is wrong, just clarifying what I am seeing. Is
>> it intended that at_exit() handlers are inherited by a fork()ed
>> process? For example:
>>
>> at_exit { puts "Doing something important for #{Process.pid}." }
>> fork
>>
>> James Edward Gray II
>>
>
> it's expected, and easy to get around if you want:
>
> fork do
> at_exit{ exit! }
> end
>
> you just have to do it right up front in order to dis-own the
> handlers from the parent - i do this is slave.rb or open4.rb - can't
> recall which offhand.
This is pretty much how we solved it. We used exit!() in the fork()ed
process.
I guess it just kind of feels like the scripting language should be
doing something more clever for us here so we don't have to do this
kind of stuff though.
James Edward Gray II