Hi all,

Well I spent a little more time on this problem and I find something
interesting.

When I dump the env() from inside the "Rivet" interpreter spawned by
apache, this environment is not the root one. It's minimal.

env(LANG) = [en_US.UTF-8]
env(get_includes_done) = [true]
env(PWD) = [/]
env(DOC_SERVER) = [no]
env(ROOTFS_BLKDEV) =
[/dev/disk/by-id/ata-M4-CT512M4SSD2_000000001203032ABACD-part2]
env(get_module_list_done) = [true]
env(vga) = [0x31a]
env(ROOTFS_FSTYPE) = [ext4]
env(SHLVL) = [0]
env(ROOTFS_FSCK) = [0]
env(splash) = [silent]
env(PATH) = [/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]

So of course my lib does not load. I suspect it's the wwwrun user's.

Any thoughts?

Thanks
B.

On Wed, Jul 31, 2013 at 8:42 AM, Brice Hamon <[email protected]>wrote:

> Hi Massimo,
>
> No I just took the 8.6 source file from the tcl website. I thought 8.6 had
> the fix already. How do I do this? I am unfamiliar with it.
>
> I just do a load with the path of the library, in my case load
> /export/home/prodmaster/work/bs/lib/libBSTclApi.so
>
> What I don't get is that the root user can load this library with all
> dependencies inside a tclsh without problem, but not within Rivet.
> I thought the fork inherits the environment from the parent's process.
>
> Thank you,
>
> Brice.
>
>
>
> On Wed, Jul 31, 2013 at 4:36 AM, Massimo Manghi 
> <[email protected]>wrote:
>
>> Hi Brice
>>
>>
>> On 30-07-2013 20:15, Brice Hamon wrote:
>>
>>> Hi guys,
>>>
>>> I decided to work around the fileevent problem and to go with tcl 8.6.
>>>
>>> So I recompiled TCL with multi-threading, my TCL API lib, and Rivet.
>>> Re-install all and run some test program by hand, so far so good.
>>>
>>>
>> did you compile the Tcl version with the fix for the fork call?
>>
>>  Now the important test I was planing is:  during the
>>> RivetInitChildScript, loading my TCL API and create some sessions.
>>>
>>> I now have a simple problem that I am sure you guys knows the answer
>>> in 10 seconds: my TCL API lib (.so) has around 10 dependencies with
>>> other .so files (mostly mine).
>>>  The RivetInitChildScript fails because it cant find dependency
>>>
>>> libraries.
>>>
>>> I am guessing my environment is not correct and I should set the
>>> LD_LIBRARY_PATH correctly.
>>>
>>> So I set the user root with the correct LD_LIBRARY_PATH (as my httpds
>>> run as root) and try by hand (tclsh -> load ...../blabla.so). All
>>> works fine.
>>>
>>> But when the same line is called in the RivetInitChildScript, the
>>> loading fails.
>>>
>>>
>> I hit myself the LD_LIBRARY_PATH problem trying to tell Apache to load
>> the Tcl library with the fix made by Jan. Eventually it worked.
>>
>> What kind of path did you put as argument of the 'load' call? Is it
>> possible
>> Apache did some chdir (mod_rivet does IIRC) that might deceive your
>> script?
>>
>>
>>  Any ideas how to set the correct path when the module is loaded and
>>> run?
>>>
>>> Thank you,
>>>
>>> Brice.
>>>
>>
>>
>>  -- Massimo
>>
>>
>>
>

Reply via email to