We actually just ran into this here at work... in our case it was our  
backgroundrb daemon that wouldn't stay alive.  Adding these two lines  
before the existing call to Kernel#fork made everything happy.  The  
code itself is borrowed from Rails' daemonize method (and IIRC  
discussed at length elsewhere as "double fork").

   exit if fork                   # Parent exits, child continues.
   Process.setsid                 # Become session leader.

This was only necessary on our Fedora Core 8 boxes, (REE and the  
daemon ran fine locally on OSX 10.5), but adding these lines didn't  
break OSX either.

HTH,
--Bob

On May 20, 2009, at 12:25 PM, lardawge wrote:

>
> Looks like there is a new release of REE that should fix this
> problem... Anyone willing to test and post back would be appreciated.
>
> On May 12, 3:11 pm, Dylan Vaughn <[email protected]> wrote:
>> I did a little looking into this.  Seems that when  you start it  
>> with -D,
>> things work.  I think there is something screwy with the process  
>> detachment
>> in the start up of the daemonized version of god.  I put this  
>> debugging code
>> in the god gem at lib/god/cli/run.rb around line 124:
>>
>> # my debugging code
>> puts "pid is #{pid}"
>> puts `ps -ef | grep #{pid}`
>> # god code
>> ::Process.detach pid
>> # more debugging code
>> puts `ps -ef | grep #{pid}`
>>
>> When I have this code in god, using REE 20090421, and try to start  
>> it up in
>> daemonized mode, it prints out the pid, shows it to me in the  
>> process list,
>> then on the second ps the god process is gone.  Running this same  
>> debug code
>> against REE 20090201 gives what you'd expect - it shows the god  
>> process both
>> before and after the ::Process.detach call.
>>
>> Not sure what changed in REE that causes this....but hopefully this  
>> helps!
>>
>> Dylan
>>
>> On Tue, May 12, 2009 at 11:42 AM, dynamic50  
>> <[email protected]>wrote:
>>
>>
>>
>>> Fair play, I will do just that, I guess this means the end of the  
>>> line
>>> for me and REE with god... for now at least
>>
>>> Jason
>>
>>> http://www.dynamic50.com
>>
>>> On May 12, 6:40 pm, lardawge <[email protected]> wrote:
>>>> Revert to REE 20090201. It doesn't look like there is much interest
>>>> from either developer to look into the problem. I imagine because  
>>>> god
>>>> never claimed to be compatible with REE and REE didn't break any  
>>>> other
>>>> gems. Fair enough. Unless someone around here is savvy enough to
>>>> understand the problem and submit a patch, it may never happen.
>>
>>>> On May 12, 1:36 pm, dynamic50 <[email protected]> wrote:
>>
>>>>> Has anyone found a fix for this yet by any chance?
>>
>>>>> Cheers,
>>
>>>>> Jason Green
>>
>>>>> http://www.dynamic50.com
>>
>>>>> On May 11, 5:24 pm, Dylan Vaughn <[email protected]> wrote:
>>
>>>>>> I had this problem also.  I'm running Debian Etch 32-bit and
>>> installed REE
>>>>>> 20090421 from source and god wouldn't start up.  When started  
>>>>>> with -D
>>> it
>>>>>> just opened the drb port then that was it...didn't do anything  
>>>>>> else,
>>> but
>>>>>> didn't die either.  When I started it normally it just  
>>>>>> immediately
>>> died.
>>
>>>>>> When I went back to REE 20090201 it works fine again.
>>
>>>>>> On Mon, May 4, 2009 at 7:38 AM, lardawge <[email protected]>  
>>>>>> wrote:
>>
>>>>>>> Answered my own question... install from source... was using the
>>> deb
>>>>>>> package on REE website. It is working for me as well with the
>>> earlier
>>>>>>> version of REE.
>>
>>>>>>> On Apr 30, 11:17 pm, lardawge <[email protected]> wrote:
>>>>>>>> So how are you running a 32-bit version? I can't get the
>>> installer to
>>>>>>>> run... from source?
>>
>>>>>>>> On Apr 30, 7:26 pm, Carl Humphrey <[email protected]>  
>>>>>>>> wrote:
>>
>>>>>>>>> Ah , yes , im running 64 bit 8.10 ubuntu server
>>
>>>>>>>>> Cheers
>>>>>>>>> Carl.
>>
>>>>>>>>> On 1/05/2009, at 9:51 AM, lardawge wrote:
>>
>>>>>>>>>> It is working for me on my dev machine running Osx but does
>>> not run
>>>>>>> on
>>>>>>>>>> linux 8.04 running 64-bit version. Unfortunately I can't run
>>> the 32-
>>>>>>>>>> bit version so I can't revert. What OS are you running it on?
>>
>>>>>>>>>> On Apr 30, 4:08 am, Carlos <[email protected]> wrote:
>>>>>>>>>>> Hi All,
>>
>>>>>>>>>>> Looks like god no longer works with Ruby Enterprise Edition
>>> 20090421
>>
>>>>>>>>>>> However when I revert back to version 20090201 it works
>>> fine.
>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> Carl.
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"god.rb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/god-rb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to