compiling freeradius with oracle support
Hi I manage to compil freeradius (2.0.5) with oracle support and so i installed the oracle instantclient (11_1) and its sdk... all this in /opt/oracle When launching compilation (using the dpkg-builpackage wrapper and rules files modified to enable oracle) i get a problem: The rlm_sql_oracle driver compilation is silently skip whereas i did specify the appropriate (well i guess they are appropriate): --with-rlm-sql-oracle=yes --with-oracle-home-dir=/opt/oracle --with-oracle-lib-dir=/opt/oracle/instantclient_11_1/ --with-oracle-include-dir=/opt/oracle/instantclient_11_1/sdk/include It says headers (oci.h) are not found, but this file realy is in the specified include path. So i decided to start the dirty stuff and set $oracle_include_dir as an environment variable doing manual configure (don't know if i can do it with dpkg-buildpackage) oracle_include_dir=/opt/oracle/instantclient_11_1/sdk/include ./configure ..... this made the header test successfull but i can't still make it find libs which are in /opt/oracle/instantclient: ~$ ls /opt/oracle/instantclient_11_1/ adrci genezi libclntsh.so.11.1 libocci.so libociei.so ojdbc5.jar sdk BASIC_README libclntsh.so libnnz11.so libocci.so.11.1 libocijdbc11.so ojdbc6.jar Does anyone have a clue what i could do?
Alexandre Chapellon wrote:
It says headers (oci.h) are not found, but this file realy is in the specified include path.
The configure logs should say why it wasn't built, but even that isn't really worth looking at.
Does anyone have a clue what i could do?
$ vi src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile Set TARGET = rlm_sql_oracle, and edit the CFLAGS && LDFLAGS lines to ave the appropriate values: -I/opt/oracle/instantclient_11_1/sdk/include, and -L /opt/oracle/instantclient_11_1/ -loracle (?) After than, cd to the directory, and type "make". Alan DeKok.
Ok the modules compils great. and it creates rlm_sql_oracle-2.0.5.so (and its symlink). I copy thoose two files in /usr/lib/freeradius but when launching freeradius -X i get: rlm_sql (sql): Driver rlm_sql_oracle (module rlm_sql_oracle) loaded and linked rlm_sql (sql): Attempting to connect to radius@localhost:/radius rlm_sql (sql): starting 0 rlm_sql (sql): Attempting to connect rlm_sql_oracle #0 freeradius: symbol lookup error: /usr/lib/freeradius/rlm_sql_oracle.so: undefined symbol: OCIEnvCreate Of course I installed the Oracle instantclient. I also added /opt/oracle/instantclient_11_1 in ld.so.conf and ran ldconfig afterwards. I tried to export ORACLE_HOME (to /opt/oracle and to /op/oracle/instantclient_11_1) as an enveronment variable prior to starting freeradius... but still with no success. I have to say that no oracle instance is installed on the server (only the client libs shipped in the basic.zip file, provided by oracle) and so the instance freeradius is trying to connect to doesn't exist yet.... but i doubt this should be a problem for starting freeradius. If anyone can help.... welcome. Alan DeKok a écrit :
Alexandre Chapellon wrote:
It says headers (oci.h) are not found, but this file realy is in the specified include path.
The configure logs should say why it wasn't built, but even that isn't really worth looking at.
Does anyone have a clue what i could do?
$ vi src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile
Set TARGET = rlm_sql_oracle, and edit the CFLAGS && LDFLAGS lines to ave the appropriate values: -I/opt/oracle/instantclient_11_1/sdk/include, and -L /opt/oracle/instantclient_11_1/ -loracle (?)
After than, cd to the directory, and type "make".
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alexandre Chapellon wrote:
Ok the modules compils great. and it creates rlm_sql_oracle-2.0.5.so (and its symlink). I copy thoose two files in /usr/lib/freeradius but when launching freeradius -X i get: ... freeradius: symbol lookup error: /usr/lib/freeradius/rlm_sql_oracle.so: undefined symbol: OCIEnvCreate
And we now see the reason why the "configure" script didn't work.
Of course I installed the Oracle instantclient. I also added /opt/oracle/instantclient_11_1 in ld.so.conf and ran ldconfig afterwards.
Is the library in that directory, or in /opt/oracle/instantclient_11_1/lib ? In any case, use the *same* library path here that you used in the Makefile, as the "-L" argument, It should then work.
I have to say that no oracle instance is installed on the server (only the client libs shipped in the basic.zip file, provided by oracle) and so the instance freeradius is trying to connect to doesn't exist yet.... but i doubt this should be a problem for starting freeradius.
That's fine. The error above is much earlier in the startup process than the "connect to Oracle" phase. Alan DeKok.
Alan DeKok a écrit :
Alexandre Chapellon wrote:
Ok the modules compils great. and it creates rlm_sql_oracle-2.0.5.so (and its symlink). I copy thoose two files in /usr/lib/freeradius but when launching freeradius -X i get: ... freeradius: symbol lookup error: /usr/lib/freeradius/rlm_sql_oracle.so: undefined symbol: OCIEnvCreate
And we now see the reason why the "configure" script didn't work.
Of course I installed the Oracle instantclient. I also added /opt/oracle/instantclient_11_1 in ld.so.conf and ran ldconfig afterwards.
Is the library in that directory, or in /opt/oracle/instantclient_11_1/lib ?
There is no lib/ in /opt/oracle/instantclient_11_1 as you can see: ~$ ls /opt/oracle/instantclient_11_1/ adrci BASIC_README genezi libclntsh.so libclntsh.so.11.1 libnnz11.so libocci.so libocci.so.11.1 libociei.so libocijdbc11.so ojdbc5.jar ojdbc6.jar sdk
In any case, use the *same* library path here that you used in the Makefile, as the "-L" argument, It should then work.
here is the modified Makefile: include ../../../../../Make.inc TARGET = rlm_sql_oracle SRCS = sql_oracle.c RLM_SQL_CFLAGS = -I/opt/oracle/instantclient_11_1/sdk/include RLM_SQL_LIBS = -L/opt/oracle/instantclient_11_1 include ../rules.mak As you can see i have here the same path in lib path and in the makefile: ~$ cat /etc/ld.so.conf.d/oracle.conf /opt/oracle/instantclient_11_1 I am wondering if something is not missing in the oracle libs i installed...? Do you have any clue that can help me to findout what is hapenning?
I have to say that no oracle instance is installed on the server (only the client libs shipped in the basic.zip file, provided by oracle) and so the instance freeradius is trying to connect to doesn't exist yet.... but i doubt this should be a problem for starting freeradius.
That's fine. The error above is much earlier in the startup process than the "connect to Oracle" phase.
Ok I was pretty sure of that.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alexandre Chapellon wrote:
I am wondering if something is not missing in the oracle libs i installed...?
That certainly could be the case.
Do you have any clue that can help me to findout what is hapenning?
No idea, sorry. Every time I've built with Oracle support, it's just worked... Alan DeKok.
Alan DeKok a écrit :
Alexandre Chapellon wrote:
I am wondering if something is not missing in the oracle libs i installed...?
That certainly could be the case.
Do you have any clue that can help me to findout what is hapenning?
No idea, sorry. Every time I've built with Oracle support, it's just worked...
then could you point me to the place where you get the oracle libs stuff?
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alexandre Chapellon wrote:
then could you point me to the place where you get the oracle libs stuff?
I've always just built with whatever libraries Oracle put on the system. i.e. it was pre-installed at customer sites. I'd suggest rooting through the libraries to find out where the failing symbol is, and what else needs to be done to link with it. Alan DeKok.
Do you remember which version of oracle instantclient you used to successfully compil rlm_sql_oracle? Alan DeKok a écrit :
Alexandre Chapellon wrote:
then could you point me to the place where you get the oracle libs stuff?
I've always just built with whatever libraries Oracle put on the system. i.e. it was pre-installed at customer sites.
I'd suggest rooting through the libraries to find out where the failing symbol is, and what else needs to be done to link with it.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi everybody, I'm wondering if it is possible to authenticate using 2 modules by ANDing them? (the 2 modules must return true, to be a sucessfully authentication). If so, would you please give me some pointers to documents, I will take it from there. Best Regards, Christian Lete
Christian Lete wrote:
I'm wondering if it is possible to authenticate using 2 modules by ANDing them? (the 2 modules must return true, to be a sucessfully authentication). If so, would you please give me some pointers to documents, I will take it from there.
Yes. See "man unlang". You can put logic into the "Auth-Type" sections, and the logic will need to succeed for authentication to succeed. Alan DeKok.
Christian Lete wrote:
I'm wondering if it is possible to authenticate using 2 modules by ANDing them? (the 2 modules must return true, to be a sucessfully authentication). If so, would you please give me some pointers to documents, I will take it from there.
Yes. See "man unlang". You can put logic into the "Auth-Type" sections, and the logic will need to succeed for authentication to succeed.
Alan DeKok.
Dear Alan, Thanks for the information! Cheers, Christian
OK After I investigated a little bit more, something seems surporising to me. First of all I can find the missing symbol (OCIEnvCreate) in the lib installed by the oracle instantclient: nm /opt/oracle/instantclient_11_1/libocci.so.11.1 | grep OCIEnvCreate U OCIEnvCreate nm /opt/oracle/instantclient_11_1/libclntsh.so.11.1 | grep OCIEnvCreate 001d0218 T OCIEnvCreate but in the same time i can see that the oracle module is not linked with any of the oracle lib!!? ldd /usr/lib/freeradius/rlm_sql_oracle.so linux-gate.so.1 => (0xf57fe000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e84000) /lib/ld-linux.so.2 (0xb7fdd000) Do you think it's normal? how can force linking? Alan DeKok a écrit :
Alexandre Chapellon wrote:
Do you remember which version of oracle instantclient you used to successfully compil rlm_sql_oracle?
Oracle 10, IIRC.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alexandre Chapellon wrote:
First of all I can find the missing symbol (OCIEnvCreate) in the lib installed by the oracle instantclient:
That's good.
but in the same time i can see that the oracle module is not linked with any of the oracle lib!!?
That's bad.
Do you think it's normal? how can force linking?
I don't think it's normal. I don't know how to force linking. Maybe try running the various 'ld' commands by hand. The libtool wrapper may be getting in the way. Alan DeKok.
Alan DeKok a écrit :
Alexandre Chapellon wrote:
First of all I can find the missing symbol (OCIEnvCreate) in the lib installed by the oracle instantclient:
That's good.
but in the same time i can see that the oracle module is not linked with any of the oracle lib!!?
That's bad.
Do you think it's normal? how can force linking?
I don't think it's normal. I don't know how to force linking. Maybe try running the various 'ld' commands by hand. The libtool wrapper may be getting in the way.
Oh my! Do you know what thoose commands are, or where i can find them.?
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alan DeKok a écrit :
Alexandre Chapellon wrote:
Oh my! Do you know what thoose commands are, or where i can find them.?
Err.. "man ld"? Watch the output of running "make", and see what commands it runs, then try variants of those?
Is there a possibility to have an (even commercial) assistance for installing freeradius with that bloody oracle support or what do you suggest ; as searching through ld commands smells not efficient enough for a quick resolution of this issue.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alan DeKok a écrit :
Alexandre Chapellon wrote:
Oh my! Do you know what thoose commands are, or where i can find them.?
Err.. "man ld"? Watch the output of running "make", and see what commands it runs, then try variants of those?
OK. At last I got it! but how painfull it has been!!!! In fact i had to set RLM_SQL_LIBS to -L/opt/oracle/instantclient_11_1/ -lclntsh -lm in the Makefile of rlm_sql_oracle (which is done by configure script when it works). and create a missing symlink in the oracle instantclient: libclntsh.so -> libclntsh.so.11 Then you can run make. the problem is, when you use wrapper as dpkg-buildpackage you can't run configure first, change one Makefileand then make.... so at the moment building without oracle support and have a tar.gz containing oracle module (compiled afterwards) seems the only soutions.... it's a bit tricky but works and is still helpfull for massive deployement.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alexandre Chapellon wrote:
In fact i had to set RLM_SQL_LIBS to -L/opt/oracle/instantclient_11_1/ -lclntsh -lm in the Makefile of rlm_sql_oracle (which is done by configure script when it works).
It wasn't working?
and create a missing symlink in the oracle instantclient: libclntsh.so -> libclntsh.so.11
That would help, yes. That was likely the cause of much of the problems. I'll bet that if you re-ran configure after making that change, it would Just Work.
the problem is, when you use wrapper as dpkg-buildpackage you can't run configure first, change one Makefileand then make.... so at the moment building without oracle support and have a tar.gz containing oracle module (compiled afterwards) seems the only soutions.... it's a bit tricky but works and is still helpfull for massive deployement.
Ah. Another wrapper layer around the build system makes it even harder to get it to work. Alan DeKok.
Alan DeKok a écrit :
Alexandre Chapellon wrote:
then could you point me to the place where you get the oracle libs stuff?
I've always just built with whatever libraries Oracle put on the system. i.e. it was pre-installed at customer sites.
I'd suggest rooting through the libraries to find out where the failing symbol is, and what else needs to be done to link with it.
Sorry but i don't understand what you mean... could explaint me in a little bit more detailled maner pls.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Alexandre Chapellon -
Christian Lete