Hi,<div>from the log you pasted is clear that the problem is that kamailio is starting before mysql.</div><div>This because, as you said, they have the same priority and so, being the starting order alphabetical for the same priority, kamailio will start before mysql and cannot connect to mysql which is still not up. </div>
<div>You told that changing kamailio priority didn&#39;t change the result. How did you change the priority? Did you use the update-rc.d command?</div><div><br></div><div>Regards,</div><div><br></div><div>Federico<br><br>
<div class="gmail_quote">2011/4/12 Rick Aldred <span dir="ltr">&lt;<a href="mailto:eazilyled@yahoo.co.uk">eazilyled@yahoo.co.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div>I have set up kamailio 3.1.2 on an install of Debian Squeeze, using the default config but with the following defines enabled:</div>
<div><br></div><div>WITH_MYSQL</div><div>WITH_AUTH</div><div>WITH_USRLOCDB</div><div>WITH_NAT</div><div><br></div><div>Everything works as expected when starting Kamailio from a terminal, e.g.</div><div>service kamailio start</div>
<div><br></div><div>But after a reboot, the service fails to start and all SIP requests are dropped with a ICMP port unreachable error.</div><div><br></div><div>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?</div><div><br></div><div><div>Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: db_mysql [km_my_con.c:109]: driver error: Can&#39;t connect to local MySQL server through socket &#39;/var/run/mysqld/mysqld.sock&#39; (2)</div>
<div>Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: &lt;core&gt; [db.c:289]: could not add connection to the pool</div><div>Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: usrloc [dlist.c:486]: failed to open database connection</div>
<div>Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: registrar [reg_mod.c:396]: failed to register domain</div><div>Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: &lt;core&gt; [route.c:1161]: fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:569</div>
<div>Apr 12 10:08:31 SIPServer /usr/sbin/kamailio[1347]: ERROR: &lt;core&gt; [route.c:1161]: fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:572</div><div>Apr 12 10:08:31 SIPServer
 /usr/sbin/kamailio[1347]: ERROR: &lt;core&gt; [route.c:1161]: fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:574</div><div>Apr 12 10:08:34 SIPServer mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql</div>
<div>Apr 12 10:08:34 SIPServer mysqld: 110412 10:08:34 [Note] Plugin &#39;FEDERATED&#39; is disabled.</div><div>Apr 12 10:08:36 SIPServer mysqld: 110412 10:08:36  InnoDB: Started; log sequence number 0 44233</div><div>Apr 12 10:08:36 SIPServer mysqld: 110412 10:08:36 [Note] Event Scheduler: Loaded 0 events</div>
<div>Apr 12 10:08:36 SIPServer mysqld: 110412 10:08:36 [Note] /usr/sbin/mysqld: ready for connections.</div><div>Apr 12 10:08:36 SIPServer mysqld: Version: &#39;5.1.49-3&#39;  socket: &#39;/var/run/mysqld/mysqld.sock&#39;  port: 3306  (Debian)</div>
</div><div><br></div><div>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.</div><div><br></div><div>I am relatively new to Kamailio and mysql as well as Linux / Debian administration, so I&#39;m not really sure how to solve this problem. Any ideas would be greatly appreciated.</div>
<div><br></div><div>Regards,</div><div>Rick Aldred</div><font color="#888888"><div><br></div></font></div></div></td></tr></tbody></table><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>