[Asterisk-Users] Asterisk MySQL CDR - MySQL starting too late

Dennis Gilmore dennis at ausil.us
Sun Nov 20 20:10:48 MST 2005


Once upon a time Sunday 20 November 2005 8:39 pm, Matt Riddell wrote:
> 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 scripts
>
> If it's running using services, you could set MySQL to start on level 2 and
> Asterisk on level 3.
>
> chkconfig --list
umm.  you obviously dont understand how the different run levels work.   run 
level 2 has nothing to do with run level 3 the easiest way would be to put 
in /etc/rc.local 
/etc/init.d/asterisk restart   then asterisk will be restarted very last thing 
before you get a login prompt.   that is the only way to do it without 
changing the priorites in the init scripts  to make sure asterisk starts 
later.

though on my setup my init scripts are set to run asterisk almost last  and 
way after mysql  has started.

-- 
Dennis Gilmore,  RHCE  
<dennis AT ausil DOT us> http://www.ausil.us
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20051121/3d29ddde/attachment.pgp


More information about the asterisk-users mailing list