Hi, I've been poking 3.0 master (GIT from yesterday) with a stick. Despite some things that make "make install" fail, there's at least one thing preventing me from running it in build/ even. "BOILER=yes make" omits the rlm_sql_mysql driver for some reason. The libs and headers are there, and configure looks good: === configuring in ./drivers/rlm_sql_mysql (/root/freeradius-master/src/modules/rlm_sql/./drivers/rlm_sql_mysql) configure: running /bin/sh ./configure '--prefix=/usr/local/freeradius/3.0-20120813' '--sysconfdir=/usr/local/freeradius/config/' '--enable-ltdl-install' --cache-file=/dev/null --srcdir=. checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for mysql_config... yes checking for pthread_create in -lpthread... yes checking for mysql_init in -lmysqlclient_r (using mysql_config)... yes checking for mysql.h (using mysql_config --cflags)... yes configure: creating ./config.status config.status: creating Makefile config.status: creating config.h === configuring in ... But then the build only picks up the rlm_sql_null driver: LINK build/lib/rlm_sometimess.la CC src/modules/rlm_sql/drivers/rlm_sql_null/sql_null.c In file included from /root/freeradius-master/src/modules/rlm_sql/rlm_sql.h:15, from src/modules/rlm_sql/drivers/rlm_sql_null/sql_null.c:28: /root/freeradius-master/src/freeradius-devel/modpriv.h:15:1: warning: "WITHOUT_LIBLTDL" redefined <command-line>: warning: this is the location of the previous definition src/modules/rlm_sql/drivers/rlm_sql_null/sql_null.c: In function ‘sql_init_socket’: src/modules/rlm_sql/drivers/rlm_sql_null/sql_null.c:45: warning: assignment discards qualifiers from pointer target type LINK build/lib/rlm_sql_null.la CC src/modules/rlm_sql/rlm_sql.c In file included from src/modules/rlm_sql/rlm_sql.h:15, from src/modules/rlm_sql/rlm_sql.c:40: /root/freeradius-master/src/freeradius-devel/modpriv.h:15:1: warning: "WITHOUT_LIBLTDL" redefined <command-line>: warning: this is the location of the previous definition CC src/modules/rlm_sql/sql.c In file included from src/modules/rlm_sql/rlm_sql.h:15, from src/modules/rlm_sql/sql.c:37: /root/freeradius-master/src/freeradius-devel/modpriv.h:15:1: warning: "WITHOUT_LIBLTDL" redefined <command-line>: warning: this is the location of the previous definition LINK build/lib/rlm_sql.la CC src/modules/rlm_sql_log/rlm_sql_log.c LINK build/lib/rlm_sql_log.la CC src/modules/rlm_sqlcounter/rlm_sqlcounter.c LINK build/lib/rlm_sqlcounter.la CC src/modules/rlm_sqlippool/rlm_sqlippool.c In file included from src/modules/rlm_sql/rlm_sql.h:15, from src/modules/rlm_sqlippool/rlm_sqlippool.c:32: /root/freeradius-master/src/freeradius-devel/modpriv.h:15:1: warning: "WITHOUT_LIBLTDL" redefined <command-line>: warning: this is the location of the previous definition LINK build/lib/rlm_sqlippool.la CC src/modules/rlm_unix/rlm_unix.c So I tried to call make directly in the driver subdir to see where I end up, and got a source error: rlm_sql_mysql # BOILER=yes make CC sql_mysql.c@ sql_mysql.c: In function ‘sql_query’: sql_mysql.c:189: error: ‘SQL_CONFIG’ has no member named ‘sqltrace’ make: *** [sql_mysql.lo] Error 1 I then deleted the offending lines 189+190 from sql_mysql.c, which made make fail a bit later; but still no joy. I'm on GNU make 3.81 which I understand is the very bare minimum, but should do. Any hints? Greetings, Stefan Winter -- Stefan WINTER Ingenieur de Recherche Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg Tel: +352 424409 1 Fax: +352 422473
Stefan Winter wrote:
Hi,
I've been poking 3.0 master (GIT from yesterday) with a stick. Despite some things that make "make install" fail, there's at least one thing preventing me from running it in build/ even.
"BOILER=yes make" omits the rlm_sql_mysql driver for some reason.
Laziness. I don't use the various SQL drivers, so I didn't bother building them.
But then the build only picks up the rlm_sql_null driver:
Yeah. See rlm_sql/all.mk
So I tried to call make directly in the driver subdir to see where I end up, and got a source error:
rlm_sql_mysql # BOILER=yes make
That won't work. The "boiler" system requires a build from the top-level.
CC sql_mysql.c@ sql_mysql.c: In function ‘sql_query’: sql_mysql.c:189: error: ‘SQL_CONFIG’ has no member named ‘sqltrace’ make: *** [sql_mysql.lo] Error 1
I need to go fix that. I cleaned up the SQL config, but didn't check everything.
I then deleted the offending lines 189+190 from sql_mysql.c, which made make fail a bit later; but still no joy.
I'm on GNU make 3.81 which I understand is the very bare minimum, but should do.
Create an "rlm_sql_mysql/all.mk" file, and reference it from rlm_sql/all.mk Then do a build from the top of the source tree. Alan DeKok.
Hi, thanks for the quick reaction :-)
I need to go fix that. I cleaned up the SQL config, but didn't check everything.
Saw your commit in GIT, and used the one with fixes.
Create an "rlm_sql_mysql/all.mk" file, and reference it from rlm_sql/all.mk
Then do a build from the top of the source tree.
Did that; the build now descended into the subdir, but choked over one thing: CC src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:40:27: error: mysql_version.h: No such file or directory src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:41:20: error: errmsg.h: No such file or directory src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:42:19: error: mysql.h: No such file or directory My headers are installed just fine, but in a mysql/ subdir. According to the code, this *should* be detected by configure and #ifdef HAVE_MYSQL_MYSQL_H should make sure that the mysql/* files are included. But that doesn't happen, instead the "#else" is taken. That's with the up-to-date 5.5 sql libs directly from mysql.com. I fixed that in the code (removing ifdefs) and carried on; but would be nice if the build system would figure itself out. In all.mk, I added hardcoded TGT_LDLIBS = -lmysqlclient -lmysqlservices -lmygcc which allowed the build to go through (I guess configure should take care of that at some point). rlm_sql_mysql.so and friends are in the build's lib/ subdir, but still, the binary won't start: rlm_sql Creating new attribute sql-webmailsso-users-SQL-Group Could not link driver rlm_sql_mysql: rlm_sql_mysql.so: cannot open shared object file: No such file or directory Make sure it (and all its dependent libraries!)are in the search path of your system's ld. /usr/local/freeradius/config//raddb/modules/sql-webmailsso-users[1]: Instantiation failed for module "sql-webmailsso-users" I don't understand why. ldd on radiusd whows that it's linked just fine, and the lib paths are known to ld: radius-int-test:~/freeradius-master # ldd ./build/bin/radiusd linux-gate.so.1 => (0xb77a2000) libnsl.so.1 => /lib/libnsl.so.1 (0xb7781000) libresolv.so.2 => /lib/libresolv.so.2 (0xb776b000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7751000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb771a000) libfreeradius-radius.so => /root/freeradius-master/build/lib/.libs/libfreeradius-radius.so (0xb76f0000) build/lib/.libs/rlm_acct_unique.so (0xb76ec000) build/lib/.libs/rlm_acctlog.so (0xb76e9000) build/lib/.libs/rlm_always.so (0xb76e6000) build/lib/.libs/rlm_attr_filter.so (0xb76e2000) build/lib/.libs/rlm_attr_rewrite.so (0xb76dd000) build/lib/.libs/rlm_chap.so (0xb76da000) build/lib/.libs/rlm_checkval.so (0xb76d6000) build/lib/.libs/rlm_detail.so (0xb76d1000) build/lib/.libs/rlm_digest.so (0xb76cb000) build/lib/.libs/rlm_dynamic_clients.so (0xb76c8000) build/lib/.libs/rlm_eap.so (0xb76bf000) build/lib/.libs/rlm_eap_gtc.so (0xb76bc000) build/lib/.libs/rlm_eap_leap.so (0xb76b7000) build/lib/.libs/rlm_eap_md5.so (0xb76b2000) build/lib/.libs/rlm_eap_mschapv2.so (0xb76ad000) build/lib/.libs/rlm_eap_peap.so (0xb76a6000) build/lib/.libs/rlm_eap_pwd.so (0xb769e000) build/lib/.libs/rlm_eap_tls.so (0xb7699000) build/lib/.libs/rlm_eap_ttls.so (0xb7693000) build/lib/.libs/rlm_exec.so (0xb768f000) build/lib/.libs/rlm_expiration.so (0xb768c000) build/lib/.libs/rlm_expr.so (0xb7688000) build/lib/.libs/rlm_fastusers.so (0xb7682000) build/lib/.libs/rlm_files.so (0xb767e000) build/lib/.libs/rlm_jradius.so (0xb7678000) build/lib/.libs/rlm_linelog.so (0xb7674000) build/lib/.libs/rlm_logintime.so (0xb766f000) build/lib/.libs/rlm_mschap.so (0xb7665000) build/lib/.libs/rlm_pam.so (0xb7661000) build/lib/.libs/rlm_pap.so (0xb765b000) build/lib/.libs/rlm_passwd.so (0xb7656000) build/lib/.libs/rlm_perl.so (0xb764c000) build/lib/.libs/rlm_policy.so (0xb7642000) build/lib/.libs/rlm_preprocess.so (0xb763e000) build/lib/.libs/rlm_radutmp.so (0xb7639000) build/lib/.libs/rlm_realm.so (0xb7634000) build/lib/.libs/rlm_replicate.so (0xb7631000) build/lib/.libs/rlm_sim_files.so (0xb762d000) build/lib/.libs/rlm_sometimess.so (0xb762a000) build/lib/.libs/rlm_sql.so (0xb7621000) build/lib/.libs/rlm_sql_mysql.so (0xb761c000) build/lib/.libs/rlm_sql_log.so (0xb7618000) build/lib/.libs/rlm_sqlcounter.so (0xb7613000) build/lib/.libs/rlm_sqlippool.so (0xb760e000) build/lib/.libs/rlm_unix.so (0xb7609000) build/lib/.libs/rlm_wimax.so (0xb7604000) libfreeradius-eap.so => /root/freeradius-master/build/lib/.libs/libfreeradius-eap.so (0xb75fc000) libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb7495000) libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb7445000) libc.so.6 => /lib/libc.so.6 (0xb72e9000) libdl.so.2 => /lib/libdl.so.2 (0xb72e3000) /lib/ld-linux.so.2 (0xb77a3000) libpam.so.0 => /lib/libpam.so.0 (0xb72d6000) libperl.so => /usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE/libperl.so (0xb7062000) libm.so.6 => /lib/libm.so.6 (0xb7039000) libutil.so.1 => /lib/libutil.so.1 (0xb7034000) libmysqlclient.so.18 => /usr/lib/libmysqlclient.so.18 (0xb6ce5000) libz.so.1 => /lib/libz.so.1 (0xb6cd0000) libaudit.so.0 => /lib/libaudit.so.0 (0xb6cb6000) librt.so.1 => /lib/librt.so.1 (0xb6cab000) radius-int-test:~/freeradius-master # ll build/lib/.libs/rlm_sql_mysql.so -rwxr-xr-x 1 root root 30103 Aug 14 09:52 build/lib/.libs/rlm_sql_mysql.so radius-int-test:~/freeradius-master # ldd build/lib/.libs/rlm_sql_mysql.so linux-gate.so.1 => (0xb773d000) libmysqlclient.so.18 => /usr/lib/libmysqlclient.so.18 (0xb73e2000) libc.so.6 => /lib/libc.so.6 (0xb7286000) libpthread.so.0 => /lib/libpthread.so.0 (0xb726c000) libdl.so.2 => /lib/libdl.so.2 (0xb7267000) libm.so.6 => /lib/libm.so.6 (0xb723d000) librt.so.1 => /lib/librt.so.1 (0xb7233000) /lib/ld-linux.so.2 (0xb773e000) This is now going beyond my knowledge of lib-magic. Greetings, Stefan Winter
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
-- Stefan WINTER Ingenieur de Recherche Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg Tel: +352 424409 1 Fax: +352 422473
On Tue, Aug 14, 2012 at 3:02 PM, Stefan Winter <stefan.winter@restena.lu> wrote:
Hi,
thanks for the quick reaction :-)
I need to go fix that. I cleaned up the SQL config, but didn't check everything.
Saw your commit in GIT, and used the one with fixes.
Create an "rlm_sql_mysql/all.mk" file, and reference it from rlm_sql/all.mk
Then do a build from the top of the source tree.
Did that; the build now descended into the subdir, but choked over one thing:
CC src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:40:27: error: mysql_version.h: No such file or directory src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:41:20: error: errmsg.h: No such file or directory src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:42:19: error: mysql.h: No such file or directory
My headers are installed just fine, but in a mysql/ subdir. According
You mean /usr/include/mysql?
to the code, this *should* be detected by configure and
#ifdef HAVE_MYSQL_MYSQL_H
should make sure that the mysql/* files are included. But that doesn't happen, instead the "#else" is taken.
That's with the up-to-date 5.5 sql libs directly from mysql.com.
It works using ubuntu's bundled libs, which also has the headers on /usr/include/mysql/ Then again I'm using the standard make (without BOILER=yes). Can you try that as well, to narrow down the source of problem?
In all.mk, I added hardcoded
TGT_LDLIBS = -lmysqlclient -lmysqlservices -lmygcc
which allowed the build to go through (I guess configure should take care of that at some point). rlm_sql_mysql.so and friends are in the build's lib/ subdir, but still, the binary won't start:
rlm_sql Creating new attribute sql-webmailsso-users-SQL-Group Could not link driver rlm_sql_mysql: rlm_sql_mysql.so: cannot open shared object file: No such file or directory Make sure it (and all its dependent libraries!)are in the search path of your system's ld. /usr/local/freeradius/config//raddb/modules/sql-webmailsso-users[1]: Instantiation failed for module "sql-webmailsso-users"
This is now going beyond my knowledge of lib-magic.
It works for me when built without BOILER (simpe ./configure && make && make install, and enable sql) -- Fajar
Hi,
It works using ubuntu's bundled libs, which also has the headers on /usr/include/mysql/
Then again I'm using the standard make (without BOILER=yes). Can you try that as well, to narrow down the source of problem?
Without boiler, the build failed elsewhere; so I didn't go any further there.
In all.mk, I added hardcoded
TGT_LDLIBS = -lmysqlclient -lmysqlservices -lmygcc
which allowed the build to go through (I guess configure should take care of that at some point). rlm_sql_mysql.so and friends are in the build's lib/ subdir, but still, the binary won't start:
rlm_sql Creating new attribute sql-webmailsso-users-SQL-Group Could not link driver rlm_sql_mysql: rlm_sql_mysql.so: cannot open shared object file: No such file or directory Make sure it (and all its dependent libraries!)are in the search path of your system's ld. /usr/local/freeradius/config//raddb/modules/sql-webmailsso-users[1]: Instantiation failed for module "sql-webmailsso-users"
This is now going beyond my knowledge of lib-magic.
It works for me when built without BOILER (simpe ./configure && make && make install, and enable sql)
All the other modules are linked correctly (I got the server to start up with the sql_null driver). So I guess I'm missing something subtle in those all.mk modifications or so. Stefan -- Stefan WINTER Ingenieur de Recherche Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg Tel: +352 424409 1 Fax: +352 422473
Stefan Winter wrote:
Did that; the build now descended into the subdir, but choked over one thing:
CC src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:40:27: error: mysql_version.h: No such file or directory src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:41:20: error: errmsg.h: No such file or directory src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c:42:19: error: mysql.h: No such file or directory
My headers are installed just fine, but in a mysql/ subdir. According to the code, this *should* be detected by configure and
Except the "configure" script doesn't create rlm_sql_mysql/all.mk. You did. You've got to add in the correct CFLAGS. See the Makefile in that directory for details.
I fixed that in the code (removing ifdefs) and carried on; but would be nice if the build system would figure itself out.
The old build system does figure that out. The new one doesn't, because not all of the modules have been converted over yet.
In all.mk, I added hardcoded
TGT_LDLIBS = -lmysqlclient -lmysqlservices -lmygcc
This list really should be taken from the Makefile in that directory.
which allowed the build to go through (I guess configure should take care of that at some point). rlm_sql_mysql.so and friends are in the build's lib/ subdir, but still, the binary won't start:
If you're running it from the build directory, you need to set LD_LIBRARY_PATH. The need to set that is some of the reason why libtool has such deep and bizarre magic.
This is now going beyond my knowledge of lib-magic.
You should be able to just do "make install". The new make system automatically tracks dependencies all the way through to installed files. So change one C file, do "make install", and one file gets re-built and re-installed. Very nice. There are some caveats, the "raddb" directory hasn't been updated to use the new build system. So you'll have to handle that manually. If it's too much of a pain, just use the old build system. It's extremely slow, but it works. Alan DeKok.
Hi,
If you're running it from the build directory, you need to set LD_LIBRARY_PATH. The need to set that is some of the reason why libtool has such deep and bizarre magic.
Cool. That worked.
There are some caveats, the "raddb" directory hasn't been updated to use the new build system. So you'll have to handle that manually.
No problem at all. I could re-use my 2.1.12 config with very minimal adaptations - moved user/group/allow_core_dumps into security { } and added empty post-auth { } and accounting { } stanzas to my sql modules. They didn't do real accounting or post-auth before, so no need to convert actual statements. These changes are even backward compatible as they are ignored by 2.1. So I have one single SVN version of the config files which will start 2.1 or 3.0. Pretty nice. So, now that I'm at "Ready to process requests" I'll run some auth stuff through... Stefan -- Stefan WINTER Ingenieur de Recherche Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg Tel: +352 424409 1 Fax: +352 422473
Stefan Winter wrote:
No problem at all. I could re-use my 2.1.12 config with very minimal adaptations - moved user/group/allow_core_dumps into security { } and added empty post-auth { } and accounting { } stanzas to my sql modules. They didn't do real accounting or post-auth before, so no need to convert actual statements.
Hmm... those sections shouldn't be mandatory. I'll fix that.
These changes are even backward compatible as they are ignored by 2.1. So I have one single SVN version of the config files which will start 2.1 or 3.0. Pretty nice.
Yup. Alan DeKok.
Hi,
Hmm... those sections shouldn't be mandatory. I'll fix that.
Thanks! As I did some tests, it occured to me that the behaviour of rlm_sql will change significantly if running it with a 2.1 config. I had num_sql_socks = 2 which opened two sockets on startup, and never closed them. If not defining a pool in 3.0, rlm_sql behaves very greedy. It opened one connection to the server to deliver my SELECT, and immediately closed it again: (0) sql-vpn : expand: %{User-Name} -> ctompers (0) sql-vpn : sql_set_user escaped user --> 'ctompers' rlm_sql (sql-vpn): Opening additional connection (0) rlm_sql_mysql: Starting connect to MySQL server rlm_sql (sql-vpn): Reserved connection (0) (0) sql-vpn : expand: SELECT id, username, attribute, value, op FROM check_vpn WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM check_vpn WHERE username = 'ctompers' ORDER BY id Executing query SELECT id, username, attribute, value, op FROM check_vpn WHERE username = 'ctompers' ORDER BY id (0) sql-vpn : User found in radcheck table rlm_sql (sql-vpn): Released connection (0) rlm_sql (sql-vpn): Closing idle connection (0): Too many free connections (1 > 0) rlm_sql (sql-vpn): Closing connection (0) It also meant I realised only during runtime that something was wrong with my MySQL uplink - with 2.x, I'd get the errors right on startup. If that setting is kept, it generates lots of useless load, a full TCP handshake + MySQL login for every single query! Of course you could say: your bad, why didn't you configure the pool! That's right (and now that I've realised it, I will of course work with pools right away), but it creates surprises for people who just run 3.0 with their 2.1 config. According to -users, that seems to be a popular thing to do, judging from the many 1.x -> 2.x conversions going wrong. For backwards-compatibility, it might make sense to convert the num_sql_socks statement into a pool block implicitly, like: num_sql_socks = 2 => pool { start = 2 min = 2 max = 2 spare = 2 uses = 0 lifetime = 0 idle_timeout = 0 } That should conserve the old behaviour. Greetings, Stefan Winter -- Stefan WINTER Ingenieur de Recherche Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg Tel: +352 424409 1 Fax: +352 422473
Stefan Winter wrote:
If not defining a pool in 3.0, rlm_sql behaves very greedy.
Well... the whole point of the new pool configuration is to use it.
It opened one connection to the server to deliver my SELECT, and immediately closed it again:
It looks like the defaults aren't set when there's no "pool" section. I'll go fix that.
Of course you could say: your bad, why didn't you configure the pool! That's right (and now that I've realised it, I will of course work with pools right away), but it creates surprises for people who just run 3.0 with their 2.1 config. According to -users, that seems to be a popular thing to do, judging from the many 1.x -> 2.x conversions going wrong.
That's why there's raddb/README. It documents how to convert the configuration.
For backwards-compatibility, it might make sense to convert the num_sql_socks statement into a pool block implicitly, like:
num_sql_socks = 2
For various reasons, that's hard to do. And the conversion / upgrade is documented. Alan DeKok.
Hi,
That's why there's raddb/README. It documents how to convert the configuration.
Yes... I found that now, after hours of playing with the server. The filename is "README.rst" and I didn't think of looking in there because the name didn't suggest anything upgrade-related. How about renaming it to README.Upgrade-3.0 maybe? Stefan
For backwards-compatibility, it might make sense to convert the num_sql_socks statement into a pool block implicitly, like:
num_sql_socks = 2
For various reasons, that's hard to do. And the conversion / upgrade is documented.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
-- Stefan WINTER Ingenieur de Recherche Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche 6, rue Richard Coudenhove-Kalergi L-1359 Luxembourg Tel: +352 424409 1 Fax: +352 422473
participants (3)
-
Alan DeKok -
Fajar A. Nugraha -
Stefan Winter