Re: Freeradius + MySQL At System Boot = Freeradius Failure

2009-09-07 Thread James Duffy
Marinko

Do you use MySQL for NAS authentication? I have noticed that Freeradius can 
re-connect to the database for user authentication later in the process. 
However as NAS is only read during startup then if MySQL is not ready its 
understandable why Freeradius would bomb out. 

JD





From: Marinko Tarlac mangi...@gmail.com
To: FreeRadius users mailing list freeradius-users@lists.freeradius.org
Sent: Sunday, September 6, 2009 6:28:19 PM
Subject: Re: Freeradius + MySQL At System Boot = Freeradius Failure

same here... I never had similar problem when mysqld is started after 
radiusd

You should check your mysql logs to see is there any problem which 
causes slow start...

Alan Buxey wrote:
 Hi,

  
 I would have thought that a simple option in freeradius that allows it to 
 wait for mysql to startup would be nice. Am I missing something obvious 
 here? Is there a REAL solution or does freeradius not actually work with 
 mysql properly due to the fact its too quick to abandon it during bootup??


 chkconfig mysqld on
 chkconfig radiusd on

 thats all i've ever done and it works fine

 alan
 -
 List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

  

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



  -
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Freeradius + MySQL At System Boot = Freeradius Failure

2009-09-07 Thread James Duffy
Marinko

This sounds like a race will take place between the two processes if there is 
no co-ordination. If (as you say) you are able to start mysqld after radiusd 
then I think if you look at tail of /var/log/radius/radius.log you will see 
something like:

Starting connect to MySQL server for #0
Couldn't connect socket to MySQL server r...@127.0.0.1:radius
Mysql error 'Can't connect to MySQL server on '127.0.0.1' (61)'
Failed to connect DB handle #0
Ready to process requests.

and then messages about radiusd managing to re-aquire the db handles later on - 
eg:

Trying to (re)connect unconnected handle 3..
Starting connect to MySQL server for #3
got socket 3 after skipping 0 unconnected handles

There needs to be a wait-on-mysql option for radiusd startup - surely?? What 
baffles me is that I'm a newbie here and surely all the veteran users have long 
since flushed this problem out into the open - or does nobody EVER use the NAS 
sql extensions??

JD





From: Marinko Tarlac mangi...@gmail.com
To: FreeRadius users mailing list freeradius-users@lists.freeradius.org
Sent: Monday, September 7, 2009 9:54:04 PM
Subject: Re: Freeradius + MySQL At System Boot = Freeradius Failure

Well right now No but in this moment I don't have test server so I can't help 
you in this case...

Also, NAS table usually is not so big and I don't see any reason for slow start.

Is there anything in mysql logs ?

James Duffy wrote:
 Marinko
 
 Do you use MySQL for NAS authentication? I have noticed that Freeradius can 
 re-connect to the database for user authentication later in the process. 
 However as NAS is only read during startup then if MySQL is not ready its 
 understandable why Freeradius would bomb out.
 
 JD
 
 
 *From:* Marinko Tarlac mangi...@gmail.com
 *To:* FreeRadius users mailing list freeradius-users@lists.freeradius.org
 *Sent:* Sunday, September 6, 2009 6:28:19 PM
 *Subject:* Re: Freeradius + MySQL At System Boot = Freeradius Failure
 
 same here... I never had similar problem when mysqld is started after
 radiusd
 
 You should check your mysql logs to see is there any problem which
 causes slow start...
 
 Alan Buxey wrote:
  Hi,
 
   I would have thought that a simple option in freeradius that allows it 
   to wait for mysql to startup would be nice. Am I missing something 
   obvious here? Is there a REAL solution or does freeradius not actually 
   work with mysql properly due to the fact its too quick to abandon it 
   during bootup??

  chkconfig mysqld on
  chkconfig radiusd on
 
  thats all i've ever done and it works fine
 
  alan
  -
  List info/subscribe/unsubscribe? See 
  http://www.freeradius.org/list/users.html
 
  
 -
 List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
 
 
 
 -
 List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



  -
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Freeradius + MySQL At System Boot = Freeradius Failure

2009-09-05 Thread James Duffy
Hi,

Am having problems using freeradius and mysql. Basically they are both set to 
start at system boot but as MySQL takes longer to get going freeradius bombs 
out with Mysql error 'Can't connect to local MySQL server through socket 
'/var/run/mysql/mysql.sock' (2)' type errors.

I can 'fix' this by adding a time delay in rc.local between the mysql startup 
and radiusd startup but this does not seem like the right way to fix this.

Anyone else with this problem?

Malcolm



  -
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Freeradius + MySQL At System Boot = Freeradius Failure

2009-09-05 Thread James Duffy
Based on the reply from Fajar I came up with this as my rc.local:

# MySQL startup
if [ -x /usr/local/bin/mysqld_safe ]; then
/usr/local/bin/mysqld_safe --user=_mysql 
echo -n ' mysqld '
fi

# Wait for the NAS table to come online - otherwise freeradius bombs!!
while ! /usr/local/bin/mysql -uradius -pradpass -e select * from nas; radius 
| grep nasname
do
 sleep 1
done

# Freeradius startup
if [ -x /usr/local/sbin/radiusd ]; then
install -d -o _freeradius /var/run/radiusd
echo -n ' radiusd '; /usr/local/sbin/radiusd
fi

echo '.'

I would have thought that a simple option in freeradius that allows it to wait 
for mysql to startup would be nice. Am I missing something obvious here? Is 
there a REAL solution or does freeradius not actually work with mysql properly 
due to the fact its too quick to abandon it during bootup??

JD






From: Fajar A. Nugraha fa...@fajar.net
To: FreeRadius users mailing list freeradius-users@lists.freeradius.org
Sent: Saturday, September 5, 2009 11:07:57 PM
Subject: Re: Freeradius + MySQL At System Boot = Freeradius Failure

On Sat, Sep 5, 2009 at 1:23 PM, James Duffyeastcor...@ymail.com wrote:
 Hi,

 Am having problems using freeradius and mysql. Basically they are both set
 to start at system boot but as MySQL takes longer to get going freeradius
 bombs out with Mysql error 'Can't connect to local MySQL server through
 socket '/var/run/mysql/mysql.sock' (2)' type errors.

 I can 'fix' this by adding a time delay in rc.local between the mysql
 startup and radiusd startup but this does not seem like the right way to fix
 this.

You could use mysqladmin ping instead of simple sleep to make sure
that mysql REALLY works. Some manual hacking might be necessary
though. Something like

while ! mysqladmin ping;do echo -n .;sleep 1;done

-- 
Fajar
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



  -
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html