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

JP Carballo lists at netfone2x.com
Tue Nov 22 21:44:56 MST 2005


Dennis Gilmore wrote:
<snip>

>ok a little back round on runlevels.  
>
>Linux allows for up to 10 runlevels, 0-9, but usually only some of these are 
>defined by default. Runlevel 0 is defined as ``system halt''. Runlevel 1 is 
>defined as ``single user mode''. Runlevel 6 is defined as ``system reboot''. 
>Other runlevels are dependent on how your particular distribution has defined 
>them, and they vary significantly between distributions. Looking at the 
>contents of /etc/inittab usually will give some hint what the predefined 
>runlevels are and what they have been defined as.
>
>ok so  when you turn mysqld off on run level 3 and thats what you system runs 
>as mysqld  will never start. the services selected for that run level are ran 
>when you enter that run level.
>
>the order that they are run at is defined by a priority system.  so you need 
>to make sure the priority of asterisk is such that is it started after 
>mysqld.
>
>on my system  mysqld  has a priority of 64 and asterisk is 99   look 
>in /etc/rc3.d   the files starting with a S are for startup and K for 
>shutdown.  they start with lowest number  up through highest number.  that 
>last thing ran is /etc/rc.local  so you could always put in 
>there /etc/init.d/asterisk restart  to make sure its the last thing done.
>
Here's mine:

(root at vostok:~)# ll /etc/rc.d/rc3.d/*{asterisk,mysqld}
147052 lrwxrwxrwx  1 root root 16 Nov 22 20:32 /etc/rc.d/rc3.d/S11mysqld 
-> ../init.d/mysqld*
135866 lrwxrwxrwx  1 root root 18 Nov 22 20:31 
/etc/rc.d/rc3.d/S40asterisk -> ../init.d/asterisk*

and the chkconfig default levels:

(root at vostok:asterisk)# chkconfig --list | grep "asterisk\|mysqld"
mysqld             0:off    1:off    2:on    3:on    4:on    5:on    6:off
asterisk           0:off    1:off    2:on    3:on    4:on    5:on    6:off

just as they are defined in:

(root at vostok:asterisk)# grep chkconfig /etc/init.d/{asterisk,mysqld}
/etc/init.d/asterisk:# chkconfig: 2345 40 60
/etc/init.d/mysqld:# chkconfig: 2345 11 90

-- 
JP Carballo

http://www.netfone2x.com
Bringing the world closer.

It might look like I'm doing nothing, but at the cellular level, I'm really quite busy. 




More information about the asterisk-users mailing list