The Toolkit for Online Communities
18636 Community Members, 0 members online, 2209 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Q&A : setting up a second OpenAcs instace - problem loading nspostgres.so

Forum OpenACS Q&A: setting up a second OpenAcs instace - problem loading nspostgres.so

Icon of envelope Request notifications

this is what I am getting on a second instance running on port 8000 (the first one is running fine)

[20/May/2008:18:35:24][30642.3084245216][-main-] Warning: modload: could not load /usr/local/aolserver/bin/nspostgres.so: libpq.so.5: cannot open shared object file: No such file or directory
[20/May/2008:18:35:24][30642.3084245216][-main-] Error: dbdrv: failed to load driver 'postgres'

I have done this before in older versions of OpenAcs and it was quite trivial.
I had a look through the forums and found this http://openacs.org/doc/openacs-5-1/tutorial-second-database.html
but I think this is about connecting to two database from the same openacs instance, rather than what I am trying to achieve

this has nothing to do with multiple instances, it is simply a bug somewhere. I've tried various permutations and it doesn't appear a config.tcl problem.
I'd be grateful for any further pointers.
Looks like your LD_LIBRARY_PATH is not set.

Try starting it up frm the command line to see if you get the same error.

Try "echo $LD_LIBRARY_PATH" to see if the directory that contains libpq.so.5 is in the LD_LIBRARY_PATH.

You might need a shell script to set LD_LIBRARY_PATH when starting nsd.

See section 5 http://openacs.org/doc/current/aolserver4.html here look for "nsd-postgres.txt" for instructions on setting it up.

thank you dave, but the problem is not the path I don't think.
When using the version of OpenAcs 5.4.1 downloaded yesterday I run into this problem.
When using a version downloaded a week prior all is well.

I have checked what you suggested and it is fine. It appears to be something in the new download OpenAcs 5.4.1 that is causing this.
The problem is that I don't know where to look (the config file is not the issue as I am using literally the same one in both cases)

A couple of questions:

Where is libpq.so.5 located in your system?
What are the permission on the shared lib and its path?
Under which user runs your nsd?


[root@vps ~]# ls -al /usr/local/pgsql

drwxr-xr-x 3 postgres web 2048 May 17 01:11 lib

lrwxrwxrwx 1 postgres web 12 May 17 01:11 libpq.so -> libpq.so.5.1
lrwxrwxrwx 1 postgres web 12 May 17 01:11 libpq.so.5 -> libpq.so.5.1
-rwxr-xr-x 1 postgres web 111295 May 17 01:11 libpq.so.5.1


nsd is run in both situations by the same user who is member of the web group

You are sure, this is the libpq, which was used for linking with nspostgres.so? When you are on linux, try "ldd /usr/local/aolserver/bin/nspostgres.so" to check the path.

We had a few years ago the problem, that psql worked perfectly, but aolserver was not able to load nspostgres. The problem were default permissions on the system that were used during the make install.... since aolserver switches to the specified user+group before loading the .so files, things went wrong withing aolserver. Sounds suspiciously like what you are seeing.


problem solved, silly syntax...

there was a mistake in the run script in daemontools. Indeed the issue was $LD_LIBRARY_PATH not being set.

thank you both for your help