mysql.sock moved and cannot be found by freeradius !
Hi, and a big HEEEEEEEEEEEELP ( or should I say - save our/my soul ).... I've moved my mysql database to another partition ( databases were getting big ) and Ive corrected my mysql config so that the socket file is now located at /data/mysql/mysql.sock. Restarted MySql - and it worked.. but my freeradius ( 1.0.5 ) first crashed with seg. fault ( I suppose this happened because of an Access-Request packet while restarting the server )... and when I started it for the second time - it said that it cannot find the mysql.sock file in the "usual" place ( /var/lib/mysql/mysql.sock )... is the location of mysql.sock hard-coded in freeradius ? What can I do to get my radius connect to mysql ? Thank you very much in advance... Regards, Edvin Seferovic
Seferovic Edvin" <edvin.seferovic@kolp.at> wrote:
when I started it for the second time - it said that it cannot find the mysql.sock file in the "usual" place ( /var/lib/mysql/mysql.sock )... is the location of mysql.sock hard-coded in freeradius ?
No. See "sql.conf". Alan DeKok.
Hi, I have been looking at sql.conf, but no use.. I use localhost, usual port, username and password are okay.. and this is what freeradius says to me now. Info: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked Info: rlm_sql (sql): Attempting to connect to root@localhost:/radius Info: rlm_sql_mysql: Starting connect to MySQL server for #0 Error: rlm_sql_mysql: Couldn't connect socket to MySQL server root@localhost:radius Error: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Error: rlm_sql (sql): Failed to connect DB handle #0 Info: Ready to process requests. But according to my new mysql datadir location ( and my my.cnf file ) - the socket can be found at /data/mysql/mysql.sock... shouldn't freeRadius find out the new location? How is this done anyway? Any hints? I would be thankful ! Regards, Edvin Seferovic -----Original Message----- From: aland@nitros9.org [mailto:aland@nitros9.org] On Behalf Of Alan DeKok Sent: Sonntag, 06. November 2005 05:15 To: edvin.seferovic@kolp.at; FreeRadius users mailing list Subject: Re: mysql.sock moved and cannot be found by freeradius ! Seferovic Edvin" <edvin.seferovic@kolp.at> wrote:
when I started it for the second time - it said that it cannot find the mysql.sock file in the "usual" place ( /var/lib/mysql/mysql.sock )... is the location of mysql.sock hard-coded in freeradius ?
No. See "sql.conf". Alan DeKok.
I've had similar problems with MySQL before (not in relation to FreeRadius, but the same socket problem) and the easiest way for me to fix it was to change the hostname where the application thinks MySQL exists from localhost to the actual hostname of the machine. This bypasses the use of the mysql.sock UNIX socket and just uses the TCP socket that MySQL opens on its standard port. I'm not sure if you have mysqld's TCP port disabled, in which case this wouldn't work, but if not hopefully this will fix the problem without having to recompile MySQL. On 11/5/05, Seferovic Edvin <edvin.seferovic@kolp.at> wrote:
Hi,
I have been looking at sql.conf, but no use.. I use localhost, usual port, username and password are okay.. and this is what freeradius says to me now.
Info: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked Info: rlm_sql (sql): Attempting to connect to root@localhost:/radius Info: rlm_sql_mysql: Starting connect to MySQL server for #0 Error: rlm_sql_mysql: Couldn't connect socket to MySQL server root@localhost:radius Error: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Error: rlm_sql (sql): Failed to connect DB handle #0 Info: Ready to process requests.
But according to my new mysql datadir location ( and my my.cnf file ) - the socket can be found at /data/mysql/mysql.sock... shouldn't freeRadius find out the new location? How is this done anyway?
Any hints? I would be thankful !
Regards,
Edvin Seferovic
-----Original Message----- From: aland@nitros9.org [mailto:aland@nitros9.org] On Behalf Of Alan DeKok Sent: Sonntag, 06. November 2005 05:15 To: edvin.seferovic@kolp.at; FreeRadius users mailing list Subject: Re: mysql.sock moved and cannot be found by freeradius !
Seferovic Edvin" <edvin.seferovic@kolp.at> wrote:
when I started it for the second time - it said that it cannot find the mysql.sock file in the "usual" place ( /var/lib/mysql/mysql.sock )... is the location of mysql.sock hard-coded in freeradius ?
No. See "sql.conf".
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Seferovic Edvin wrote:
But according to my new mysql datadir location ( and my my.cnf file ) - the socket can be found at /data/mysql/mysql.sock... shouldn't freeRadius find out the new location? How is this done anyway?
I think FreeRADIUS doesn't read the file "my.cnf". To be more accurate, it doesn't tell the libmysqlclient to read the file. Question for Alan: it seems easy to pass an option to the libmysqlclient to make it read a section called "radiusd" in "my.cnf". It'd make possible to define there any options specific to MySQL which are not available through our "sql.conf". Should I try to add this to the CVS ? http://dev.mysql.com/doc/refman/4.1/en/mysql-options.html -- Nicolas Baradakis
Nicolas Baradakis <nbk@sitadelle.com> wrote:
Question for Alan: it seems easy to pass an option to the libmysqlclient to make it read a section called "radiusd" in "my.cnf". It'd make possible to define there any options specific to MySQL which are not available through our "sql.conf". Should I try to add this to the CVS ?
Sure. Alan DeKok.
On Mon, 7 Nov 2005, Alan DeKok wrote:
Nicolas Baradakis <nbk@sitadelle.com> wrote:
Question for Alan: it seems easy to pass an option to the libmysqlclient to make it read a section called "radiusd" in "my.cnf". It'd make possible to define there any options specific to MySQL which are not available through our "sql.conf". Should I try to add this to the CVS ?
If you are going to make a change in freeradius to cope with this don't waste time trying to read the my.cnf file as you wont know where it is with any certainty. Instead have a section in the sql.conf to specify the mysql socket file. Jason Clifford -- UKFSN.ORG Finance Free Software while you surf the 'net http://www.ukfsn.org/ 2Mb ADSL Broadband from just £14.98 / month http://www.linuxadsl.co.uk/ ADSL Routers from just £21.98
or as I said create a symlink at the old location (where freeradius looks for it) which points to the socket at the new location (where it is now)... I suppose that'd be the easiest way.... cheers Sebastian Jason Clifford wrote:
On Mon, 7 Nov 2005, Alan DeKok wrote:
Nicolas Baradakis <nbk@sitadelle.com> wrote:
Question for Alan: it seems easy to pass an option to the libmysqlclient to make it read a section called "radiusd" in "my.cnf". It'd make possible to define there any options specific to MySQL which are not available through our "sql.conf". Should I try to add this to the CVS ?
If you are going to make a change in freeradius to cope with this don't waste time trying to read the my.cnf file as you wont know where it is with any certainty.
Instead have a section in the sql.conf to specify the mysql socket file.
Jason Clifford
-- mfg S.Wild Cronon AG - Technik - +49 941 56 71 23 95 Fon direkt +49 941 59 57 91 64 Fax +49 941 79 77 58 9 SIP +49 941 56 41 03 9 Fon Technik zentral "Die Predigt in einer Kirche macht den Blitzableiter auf der selbigen nicht überflüssig!" Georg Christoph Lichtenberg
I think this is the most simple solution. Making symlinks to the usual location might be confusing for other applications or users themselves. Is there any performance difference between using .sock and tcp connection to localhost? Regards, Edvin Seferovic -----Original Message----- From: freeradius-users-bounces@lists.freeradius.org [mailto:freeradius-users-bounces@lists.freeradius.org] On Behalf Of Jason Clifford Sent: Montag, 07. November 2005 17:07 To: FreeRadius users mailing list Subject: Re: mysql.sock moved and cannot be found by freeradius ! On Mon, 7 Nov 2005, Alan DeKok wrote:
Nicolas Baradakis <nbk@sitadelle.com> wrote:
Question for Alan: it seems easy to pass an option to the libmysqlclient to make it read a section called "radiusd" in "my.cnf". It'd make possible to define there any options specific to MySQL which are not available through our "sql.conf". Should I try to add this to the CVS ?
If you are going to make a change in freeradius to cope with this don't waste time trying to read the my.cnf file as you wont know where it is with any certainty. Instead have a section in the sql.conf to specify the mysql socket file. Jason Clifford -- UKFSN.ORG Finance Free Software while you surf the 'net http://www.ukfsn.org/ 2Mb ADSL Broadband from just £14.98 / month http://www.linuxadsl.co.uk/ ADSL Routers from just £21.98 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Seferovic Edvin wrote:
I think this is the most simple solution. Making symlinks to the usual location might be confusing for other applications or users themselves.
Is there any performance difference between using .sock and tcp connection to localhost?
From MySQL documentation: http://dev.mysql.com/doc/refman/4.1/en/compile-and-link-options.html
<<<<< For a connection from a client to a server running on the same host, if you connect using TCP/IP rather than a Unix socket file, performance is 7.5% slower. (On Unix, if you connect to the hostname localhost, MySQL uses a socket file by default.)
Nicolas Baradakis -- A: Yes.
Q: Are you sure?
A: Because it reverses the logical flow of conversation.
Q: Why is top posting annoying in email?
Jason Clifford wrote:
If you are going to make a change in freeradius to cope with this don't waste time trying to read the my.cnf file as you wont know where it is with any certainty.
This is a one-line-change in FreeRADIUS: we just tell to the libmysqlclient to search and read the file "my.cnf" in its own predefined locations.
Instead have a section in the sql.conf to specify the mysql socket file.
We may run into the same problem later with a different option: I don't want to have an entry for each and every Mysql specific option in the file "sql.conf". -- Nicolas Baradakis
On Mon, 7 Nov 2005, Nicolas Baradakis wrote:
If you are going to make a change in freeradius to cope with this don't waste time trying to read the my.cnf file as you wont know where it is with any certainty.
This is a one-line-change in FreeRADIUS: we just tell to the libmysqlclient to search and read the file "my.cnf" in its own predefined locations.
There is no predefined location. That's the problem that the original poster has run into - you can have the files anywhere you like and people do.
Instead have a section in the sql.conf to specify the mysql socket file.
We may run into the same problem later with a different option: I don't want to have an entry for each and every Mysql specific option in the file "sql.conf".
And how many sql options are appropriate? It's only those needed for a client connection and other than socket file location they are already all present as options in the sql.conf file. It seems counter to good practice (ie keep it simple) to make things more complicated than simply adding an option to the file you already use to configure the sql connection and options. Jason Clifford -- UKFSN.ORG Finance Free Software while you surf the 'net http://www.ukfsn.org/ 2Mb ADSL Broadband from just £14.98 / month http://www.linuxadsl.co.uk/ ADSL Routers from just £21.98
Jason Clifford wrote:
On Mon, 7 Nov 2005, Nicolas Baradakis wrote:
If you are going to make a change in freeradius to cope with this don't waste time trying to read the my.cnf file as you wont know where it is with any certainty.
This is a one-line-change in FreeRADIUS: we just tell to the libmysqlclient to search and read the file "my.cnf" in its own predefined locations.
There is no predefined location. That's the problem that the original poster has run into - you can have the files anywhere you like and people do.
This is just not true. MySQL programs read startup options from the following files: /etc/my.cnf, /var/lib/mysql/my.cnf, ~/.my.cnf http://dev.mysql.com/doc/refman/4.1/en/option-files.html
Instead have a section in the sql.conf to specify the mysql socket file.
We may run into the same problem later with a different option: I don't want to have an entry for each and every Mysql specific option in the file "sql.conf".
And how many sql options are appropriate? It's only those needed for a client connection and other than socket file location they are already all present as options in the sql.conf file.
There are many options for a client connection. For example, the timeout options would be very useful, too. http://dev.mysql.com/doc/refman/4.1/en/mysql-options.html
It seems counter to good practice (ie keep it simple) to make things more complicated than simply adding an option to the file you already use to configure the sql connection and options.
I think we have enough options in "sql.conf" for normal use. More options will confuse the users, or confuse the people who are using a database server different from MySQL. -- Nicolas Baradakis
Symbolic linking your socket to the usual location /var/run/mysqld/mysqld.sock might help you. Do ln -s /data/mysql/mysql.sock /var/run/mysqld/mysqld.sock to do this. Freeradius should then be able to connect to mysql again. I suppose that ain't hardcoded in freeradius but it might me hardcoded in libmysqlclient which is used by any app that needs to connect to mysqld... greets Sebastian Seferovic Edvin wrote:
Hi,
and a big HEEEEEEEEEEEELP ( or should I say – save our/my soul ).... I’ve moved my mysql database to another partition ( databases were getting big ) and Ive corrected my mysql config so that the socket file is now located at /data/mysql/mysql.sock. Restarted MySql – and it worked.. but my freeradius ( 1.0.5 ) first crashed with seg. fault ( I suppose this happened because of an Access-Request packet while restarting the server )... and when I started it for the second time – it said that it cannot find the mysql.sock file in the “usual” place ( /var/lib/mysql/mysql.sock )... is the location of mysql.sock hard-coded in freeradius ?
What can I do to get my radius connect to mysql ?
Thank you very much in advance...
Regards,
Edvin Seferovic
------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (6)
-
Alan DeKok -
Andrew Teixeira -
Jason Clifford -
Nicolas Baradakis -
Sebastian Wild -
Seferovic Edvin