<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Based on the reply from Fajar I came up with this as my rc.local:<br><br># MySQL startup<br>if [ -x /usr/local/bin/mysqld_safe ]; then<br>        /usr/local/bin/mysqld_safe --user=_mysql &<br>        echo -n ' mysqld '<br>fi<br><br># Wait for the NAS table to come online - otherwise freeradius bombs!!<br>while ! /usr/local/bin/mysql -uradius -pradpass -e "select * from nas;" radius | grep nasname<br>do<br>         sleep 1<br>done<br><br># Freeradius startup<br>if [ -x /usr/local/sbin/radiusd ]; then<br>        install -d -o _freeradius /var/run/radiusd<br>        echo -n ' radiusd ';    
 /usr/local/sbin/radiusd<br>fi<br><br>echo '.'<br><br>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??<br><br>JD<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Fajar A. Nugraha <fajar@fajar.net><br><b><span style="font-weight: bold;">To:</span></b> FreeRadius users mailing list <freeradius-users@lists.freeradius.org><br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, September 5, 2009 11:07:57 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: Freeradius +
 MySQL At System Boot = Freeradius Failure<br></font><br>On Sat, Sep 5, 2009 at 1:23 PM, James Duffy<<a ymailto="mailto:eastcork75@ymail.com" href="mailto:eastcork75@ymail.com">eastcork75@ymail.com</a>> wrote:<br>> Hi,<br>><br>> Am having problems using freeradius and mysql. Basically they are both set<br>> to start at system boot but as MySQL takes longer to get going freeradius<br>> bombs out with Mysql error 'Can't connect to local MySQL server through<br>> socket '/var/run/mysql/mysql.sock' (2)' type errors.<br>><br>> I can 'fix' this by adding a time delay in rc.local between the mysql<br>> startup and radiusd startup but this does not seem like the right way to fix<br>> this.<br><br>You could use "mysqladmin ping" instead of simple sleep to make sure<br>that mysql REALLY works. Some manual hacking might be necessary<br>though. Something like<br><br>while ! mysqladmin ping;do echo -n .;sleep 1;done<br><br>--
 <br>Fajar<br>-<br>List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br></div></div></div><br>



      </body></html>