My PyLucene app freezes when run as a daemon

Andi Vajda andi@osafoundation.org
Fri Mar 23 22:48:00 GMT 2007


On Fri, 23 Mar 2007, David Daney wrote:

> Ofer Nave wrote:
>> Sorry, I should stated this explicitly:
>> 
>> I am running on linux 2.6.9.
>> 
>
> The version does not really matter.  You cannot call fork from within a 
> libgcj based application and use it for much of anything other than exec.
>
> If you want to daemonize, you should do it before calling Jv_RunMain.
>

Jv_RunMain() is not invoked since there is no Java main in Python.

But Ofer, initVM() is the PyLucene equivalent thing here. That function calls 
JvCreateJavaVM() and is invoked when the PyLucene module is first imported 
into Python.

Hence, to follow David's advice, you need to do your daemonization tricks 
before actually importing PyLucene.

Andi..



More information about the Java mailing list