TimesTen Release 11.2.1 OCI is based on Oracle Release 11.1.0.7 OCI and supports the contemporary OCI 8 style APIs.
tns_entry = (DESCRIPTION =(CONNECT_DATA =(SERVICE_NAME = dsn)(SERVER = timesten_direct | timesten_client)))
So, I want to compile freeradius to use OCI connect to TimesTen(testing):
- Setup TimesTen on radius Server by using "Client/Server and Data Manager" components.
# tar xvf timesten112120.linux8664.tar.gzI need library only, so stop TimesTen daemon:
# cd linux8664
# ./setup.sh
[...]
Please choose an instance name for this installation? [ tt1121 ]
Instance name will be 'tt1121'.
Is this correct? [ yes ] y
Of the three components:
[1] Client/Server and Data Manager
[2] Data Manager Only
[3] Client Only
Which would you like to install? [ 1 ] 1
Where would you like to install the tt1121 instance of TimesTen? [ /opt ] /oracle
Installing into /oracle/TimesTen/tt1121 ...
Creating /oracle/TimesTen/tt1121 ...
Uncompressing ...
[...]
# /oracle/TimesTen/tt1121/startup/tt_tt1121 stop- Install freeradius
Stopping TimesTen Daemon : [ OK ]
# cd SRCI installed freeradius, but no driver. So build driver by using "rlm_sql_oracle"
# tar zxf freeradius-server-2.1.7.tar.gz
# cd freeradius-server-2.1.7
# ./configure && make && make install
# cd src/modules/rlm_sql/drivers/rlm_sql_oracle/--- Begin Makefile ---
# vi Makefile
include ../../../../../Make.inc
TARGET = rlm_sql_oracle
SRCS = sql_oracle.c
INSTDIR = /oracle/TimesTen/tt1121
COMMDIR = $(INSTDIR)/quickstart/sample_code/common
TTORACLE_HOME = $(INSTDIR)/ttoracle_home/instantclient_11_1
OCIINCS = $(TTORACLE_HOME)/sdk/include
CC = gcc
PLATCFLAGS = -Os -finline-functions
LDFLAGS =
EXTRALIBS = -lpthread -lm -lrt
INCS = -I$(OCIINCS) -I$(INSTDIR)/include -I$(COMMDIR)
RLM_SQL_CFLAGS = $(INCLTDL) $(PLATCFLAGS) $(INCS)
TTLINK = -L$(INSTDIR)/lib -L$(TTORACLE_HOME) -Wl,-rpath,$(INSTDIR)/lib,-rpath,$(TTORACLE_HOME)
RLM_SQL_LIBS = $(TTLINK) -lclntsh $(EXTRALIBS)
include ../rules.mak
--- End Makefile ---
# make- Configure freeradius to use "rlm_sql_oracle"
SRC/freeradius-server-2.1.7/libtool --mode=compile gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -I../.. -ISRC/freeradius-server-2.1.7/src/ -ISRC/freeradius-server-2.1.7/libltdl -Os -finline-functions -I/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk/include -I/oracle/TimesTen/tt1121/include -I/oracle/TimesTen/tt1121/quickstart/sample_code/common -c sql_oracle.c
mkdir .libs
gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -I../.. -ISRC/freeradius-server-2.1.7/src/ -ISRC/freeradius-server-2.1.7/libltdl -Os -finline-functions -I/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk/include -I/oracle/TimesTen/tt1121/include -I/oracle/TimesTen/tt1121/quickstart/sample_code/common -c sql_oracle.c -fPIC -DPIC -o .libs/sql_oracle.o
[...]
gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -I../.. -ISRC/freeradius-server-2.1.7/src/ -ISRC/freeradius-server-2.1.7/libltdl -Os -finline-functions -I/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk/include -I/oracle/TimesTen/tt1121/include -I/oracle/TimesTen/tt1121/quickstart/sample_code/common -c sql_oracle.c -o sql_oracle.o >/dev/null 2>&1
SRC/freeradius-server-2.1.7/libtool --mode=link gcc -release 2.1.7 \
-module -export-dynamic -o rlm_sql_oracle.la \
-rpath /usr/local/lib sql_oracle.lo -L/oracle/TimesTen/tt1121/lib -L/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -Wl,-rpath,/oracle/TimesTen/tt1121/lib,-rpath,/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -lclntsh -lpthread -lm -lrt
gcc -shared .libs/sql_oracle.o -L/oracle/TimesTen/tt1121/lib -L/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -lclntsh -lpthread -lm -lrt -Wl,-rpath -Wl,/oracle/TimesTen/tt1121/lib -Wl,-rpath -Wl,/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -Wl,-soname -Wl,rlm_sql_oracle-2.1.7.so -o .libs/rlm_sql_oracle-2.1.7.so
(cd .libs && rm -f rlm_sql_oracle.so && ln -s rlm_sql_oracle-2.1.7.so rlm_sql_oracle.so)
ar cru .libs/rlm_sql_oracle.a sql_oracle.o
ranlib .libs/rlm_sql_oracle.a
creating rlm_sql_oracle.la
(cd .libs && rm -f rlm_sql_oracle.la && ln -s ../rlm_sql_oracle.la rlm_sql_orac
# make install
# ls -l /usr/local/lib | grep oracle
lrwxrwxrwx 1 root root 17 Sep 17 15:57 rlm_sql_oracle-2.1.7.la -> rlm_sql_oracle.la
-rwxr-xr-x 1 root root 27880 Sep 17 15:57 rlm_sql_oracle-2.1.7.so
-rw-r--r-- 1 root root 32296 Sep 17 15:57 rlm_sql_oracle.a
-rwxr-xr-x 1 root root 967 Sep 17 15:57 rlm_sql_oracle.la
lrwxrwxrwx 1 root root 23 Sep 17 15:57 rlm_sql_oracle.so -> rlm_sql_oracle-2.1.7.so
# cd /usr/local/etc/raddbUncomment in radiusd.conf file:
# vi radiusd.conf
[...]Add "sql" in radiusd.conf file:
$INCLUDE sql.conf
[...]
[...]- Modify "sql.conf" to connect TimesTen database
instantiate {
sql
}
[...]
# vi sql.confIn sqlconf file:
database = "oracle"
login = "radius"
password = "password"
radius_db = "(DESCRIPTION=(CONNECT_DATA = (SERVICE_NAME = db01CS)(SERVER = timesten_client)))"
- Modify odbc in /etc/odbc.ini file.
# vi /etc/odbc.iniIn odbc.ini file:
[db01CS]
TTC_SERVER=timesten_server
TTC_SERVER_DSN=db01
- Test to start freeradius
# radiusd -XA freeradius connected to TimesTen server.
[...]
rlm_sql (sql): Driver rlm_sql_oracle (module rlm_sql_oracle) loaded and linked
rlm_sql (sql): Attempting to connect to radius@localhost:/(DESCRIPTION=(CONNECT_DATA = (SERVICE_NAME = db01CS)(SERVER = timesten_client)))
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_oracle #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_oracle #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_oracle #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_oracle #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_oracle #4
rlm_sql (sql): Connected new DB handle, #4
}
[...]
No comments:
Post a Comment