Eric Bishop
2005-Nov-20 12:42 UTC
[Asterisk-Users] Asterisk MySQL CDR - MySQL starting too late
Hi All, I am running Asterisk (1.0.9.) on CentOS 4 with CDR recording being output to MySQL. However whenever the system boots up after a reboot I am needing to manually restart Asterisk because MySQL is after Asterisk in the service startup sequence and I get ERROR[3367]: Failed to connect to mysql database cdr on localhost. Anyone know of a simple and elegant way to fix this? I'd prefer not to have to hack either MySQL or Asterisk init scripts -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051120/5285029f/attachment.htm
Matt Riddell
2005-Nov-20 19:39 UTC
[Asterisk-Users] Asterisk MySQL CDR - MySQL starting too late
Eric Bishop wrote:> Hi All, > > I am running Asterisk (1.0.9.) on CentOS 4 with CDR recording being > output to MySQL. However whenever the system boots up after a reboot I > am needing to manually restart Asterisk because MySQL is after Asterisk > in the service startup sequence and I get > > ERROR[3367]: Failed to connect to mysql database cdr on localhost. > > Anyone know of a simple and elegant way to fix this? > > I'd prefer not to have to hack either MySQL or Asterisk init scriptsIf it's running using services, you could set MySQL to start on level 2 and Asterisk on level 3. chkconfig --list -- Cheers, Matt Riddell _______________________________________________ http://www.sineapps.com/news.php (Daily Asterisk News - html) http://freevoip.gedameurope.com (Free Asterisk Voip Community) http://www.sineapps.com/rssfeed.php (Daily Asterisk News - rss)
Andreas Sikkema
2005-Nov-21 02:51 UTC
[Asterisk-Users] Asterisk MySQL CDR - MySQL starting too late
> Well that didn't work. When I rebooted MySQL didn't start at all....The level doesn't set _when_ something starts, just _if_ something starts. Some daemons should start in single user mode, some not. Some others should only start when in GUI mode, others not, etc. This is what level controls. When something starts is usually controlled with the name of the start/stop scripts in /etc/rcx.d/ (or something like that). Files starting with the S00 prefix are started first, files with S99 are started last for that runlevel. The same for K00 and K99, but that describes the time when processes are killed. So if Asterisk is started using S80asterisk, and MySQL using S50mysqld, then it obviously isn't going to work as intended. The same also when both are started with S99, because asterisk will be started before mysqld... I usually mess around with the numbers, but that is not very reproducable, dependencies listed in the rpm file (or equivalent) usually takes care of this. When isntalling from source, you're on your own. -- Andreas Sikkema BBned NV Software Engineer Planeetbaan 4 +31 (0)23 7074342 2132 HZ Hoofddorp