John Hawkes-Reed wrote:
On 30/3/09 13:42, "Luciano Afranllie" <listas.luafran@gmail.com> wrote:
On Mon, Mar 30, 2009 at 6:53 AM, Tseveendorj <tseveendorj@gmail.com> wrote:
Doug Hardie wrote:
On Mar 29, 2009, at 20:10, Tseveendorj wrote:
May be I got the problem why radiusd didn't come up.
[ ... ]
In my config FreeRADIUS must work with MySQL but from the log freeradius couldn't connect to mysql server. I thought that is problem. isn't it ?
There lies the problem. It would appear that MySQL is not running when FreeRADIUS starts. Check through the messages log to seen what the startup order is. I suspect its backwards.
Check your /etc/rcx.d where x is your default runlevel. mysql should have a lower S number than freeRadius.
That would be true for a Linux/SysV startup.
The rc script for FreeRadius under FreeBSD should contain the following header:
# # PROVIDE: radiusd # REQUIRE: NETWORKING SERVERS nmbd winbindd # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable radiusd: # # radiusd_enable="YES"
There should be something similar for the MySQL startup. Take a note of the entry in the MySQL PROVIDE: line and append that to the radiusd REQUIRE: line.
That should ensure that the MySQL server is started before FreeRadius.
-- John Hawkes-Reed Systems Administrator. Future Publishing. x 2526
Hi John Thank you for trying to help me. It has but I didn't know this is exactly right. Something looks like following inside /usr/local/etc/rc.d/mysql-server # PROVIDE: mysql # REQUIRE: LOGIN # KEYWORD: shutdown inside /usr/local/etc/rc.d/radiusd # PROVIDE: radiusd # REQUIRE: NETWORKING SERVERS mysql # KEYWORD: shutdown In my opinion the MySQL starts after LOGIN process then radiusd is starting when the mysql started. But it doesn't. inside the radiusd.log Mon Mar 30 17:29:15 2009 : Info: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked Mon Mar 30 17:29:15 2009 : Info: rlm_sql (sql): Attempting to connect to root@localhost:/billing Mon Mar 30 17:29:15 2009 : Info: rlm_sql_mysql: Starting connect to MySQL server for #0 Mon Mar 30 17:29:15 2009 : Error: rlm_sql_mysql: Couldn't connect socket to MySQL server root@localhost:billing Mon Mar 30 17:29:15 2009 : Error: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Mon Mar 30 17:29:15 2009 : Error: rlm_sql (sql): Failed to connect DB handle #0 Mon Mar 30 17:29:15 2009 : Info: rlm_sql (sql): There are no DB handles to use! skipped 5, tried to connect 0 Mon Mar 30 17:29:15 2009 : Error: Failed to load clients from SQL. Mon Mar 30 17:29:15 2009 : Error: /usr/local/etc/raddb/sql.conf[22]: Instantiation failed for module "sql" Mon Mar 30 17:29:15 2009 : Error: /usr/local/etc/raddb/sites-enabled/default[149]: Failed to find module "sql". Mon Mar 30 17:29:15 2009 : Error: /usr/local/etc/raddb/sites-enabled/default[62]: Errors parsing authorize section. Mon Mar 30 17:29:15 2009 : Error: Errors initializing modules How to define the accurate config? Sincerely, Tseveen