Using asterisk 1.2.13 on centos every so often we can find our asterisk stopped. We record all cdr records to mysql which is also on the same machine. I have also had this happen on a asterisk 1.4 box once in the last 2 months.
Typing service asterisk start always gets it going again.
/var/log/asterisk/messages had the following which stopped asterisk.
Oct 23 12:47:46 ERROR res_config_mysql.c: MySQL RealTime: Failed to connect database server on (err 2002). Check debug for more info.
Oct 23 12:47:46 WARNING res_config_mysql.c: MySQL RealTime: Couldn’t establish connection. Check debug.
Any Ideas why it actually stops asterisk. I have checked mysql and every thing seems ok. Always works when you start asterisk again.
Is there a way to not have asterisk stop if it fails to write records to mysql ?