[SR-Users] Kamailio service not starting on reboot when using mysql database

Daniel-Constantin Mierla miconda at gmail.com
Tue Apr 12 13:28:59 CEST 2011


Hello,

On 4/12/11 11:34 AM, Rick Aldred wrote:
> I have set up kamailio 3.1.2 on an install of Debian Squeeze, using 
> the default config but with the following defines enabled:
>
> WITH_MYSQL
> WITH_AUTH
> WITH_USRLOCDB
> WITH_NAT
>
> Everything works as expected when starting Kamailio from a terminal, e.g.
> service kamailio start
>
> But after a reboot, the service fails to start and all SIP requests 
> are dropped with a ICMP port unreachable error.
>
> The following is an extract of /var/log/syslog when this problem 
> occurs. It looks like Kamailio is failing to access the mysql socket, 
> as the mysql service has not yet started?
>
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: db_mysql 
> [km_my_con.c:109]: driver error: Can't connect to local MySQL server 
> through socket '/var/run/mysqld/mysqld.sock' (2)
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: <core> 
> [db.c:289]: could not add connection to the pool
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: usrloc 
> [dlist.c:486]: failed to open database connection
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: registrar 
> [reg_mod.c:396]: failed to register domain
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: <core> 
> [route.c:1161]: fixing failed (code=-1) at 
> cfg:/etc/kamailio/kamailio.cfg:569
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: <core> 
> [route.c:1161]: fixing failed (code=-1) at 
> cfg:/etc/kamailio/kamailio.cfg:572
> Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: <core> 
> [route.c:1161]: fixing failed (code=-1) at 
> cfg:/etc/kamailio/kamailio.cfg:574
> Apr 12 10:08:34 SIPServer mysqld_safe: Starting mysqld daemon with 
> databases from /var/lib/mysql
> Apr 12 10:08:34 SIPServer mysqld: 110412 10:08:34 [Note] Plugin 
> 'FEDERATED' is disabled.
> Apr 12 10:08:36 SIPServer mysqld: 110412 10:08:36  InnoDB: Started; 
> log sequence number 0 44233
> Apr 12 10:08:36 SIPServer mysqld: 110412 10:08:36 [Note] Event 
> Scheduler: Loaded 0 events
> Apr 12 10:08:36 SIPServer mysqld: 110412 10:08:36 [Note] 
> /usr/sbin/mysqld: ready for connections.
> Apr 12 10:08:36 SIPServer mysqld: Version: '5.1.49-3'  socket: 
> '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
>
the logs shows that the mysql server is started after kamailio. Be sure 
you set the order at startup to run mysql first, maybe google helps to 
find the proper way.

Cheers,
Daniel

>
> Both the Kamailio and mysql services start with priority 18 on run 
> levels 2345. I tried adjusting the Kamailio service to priority 19, 
> but the problem still occurs.
>
> I am relatively new to Kamailio and mysql as well as Linux / Debian 
> administration, so I'm not really sure how to solve this problem. Any 
> ideas would be greatly appreciated.
>
> Regards,
> Rick Aldred
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://www.asipto.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110412/cfea228a/attachment.htm>


More information about the sr-users mailing list