After much head scratching I got this sorted out. It wasn't a problem with ld.so.conf and locating the libraries etc like I thought it was (I don't know how many times i ran ldconfig etc etc). The long form of the problem is this.... I think there is a bug in ./configure that caused it to not locate my postgresql installation correctly - even though it is in the standard directory /usr/local/pgsql. Perhaps it doesn't detect 7.1.3 properly or perhaps it is just plain buggy. Anyway, as a result, in Make.inc it didn't put any entry for PQ_LIBS and PG_INCLUDE_DIR and as a result it didn't build the postgresql libraries. I picked up on that fairly quickly, and manually edited Make.inc as follows: PQ_LIBS = /usr/local/pgsql/lib PG_INCLUDE_DIR = /usr/local/pgsql/include That got it to compile, but when the module was loaded it gave me the error that I mentioned in my previous email. I'm not an expert at shell scripts, but then I was trying to go through ./configure and work out why it didn't detect it automatically, and discovered that it appeared that I was setting PQ_LIBS wrongly, that it should in fact be: PQ_LIBS = -L/usr/local/pgsql/lib -lpq After doing this i recompiled, make install'd and then everything loaded up ok. I then discovered that it was giving a few SQL errors when trying to do the accounting. By turning on debugging on my postgres server I was able to determine that the problem was caused by the scripts in sql.conf. There are some numeric fields that it was trying to initialise with empty strings, and also some date fields that it was trying to initialise with 0. A few modifications to the SQL, and I now have what appears to be a working configuration on postgresql. Now I just have to madly get to work and put in place all the underlying code and database stuff to correctly handle all the possibilities with our customers and I'll be set.
Once I've got that task done, I'll happily write an FAQ on this - my way of contributing to the development, since I'm more of an applications/db programmer than a programmer of underlying stuff. ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 23, 2001 4:28 AM Subject: Re: Problem using postgresql > Graham Fountain <[EMAIL PROTECTED]> wrote: > > I am attempting to set up freeradius to use postgres, and after manually > > adding the path to the pgsql include and lib directories to make.inc i got > > the postgres modules to compile and install. but now when i try to start > > the radius server with radiusd -X , i get the following error: > > > > radiusd: error while loading shared libraries: > > /usr/local/lib/rlm_sql_postgresql > > .so.0: undefined symbol: PQconnectdb > > It's not able to link to the postgres module. > > > Does anyone have any ideas on what i'm doing wrong and how to get this to > > work? > > You probably didn't add the directory '/usr/local/pgsql/lib' to > /etc/ld.so.conf. You MUST tell the system where any new library is > located, otherwise the dynamic library loader won't be able to find > it. > > This probably should be a FAQ, even though it has nothing to do with > FreeRADIUS. > > Alan DeKok. > > - > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html > > - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
