[SR-Users] kamailio fails to start with kamctl start

Fabian Borot fborot at hotmail.com
Mon Jun 27 16:40:30 CEST 2011



I fixed the problem but I would like somebody to shed some light into this issue.

I noticed that when I run kamailio w/o telling where to load the kamailio.cfg file is when it failed. So I went to the kamctl script and notice that in the section where "kamctl start" happens the variable $STARTOPTIONS was empty. I went to the etc/kamailio/kamctlrc, un-commented the line with $STARTOPTIONS and made it like this:


 
STARTOPTIONS=" -f /usr/local/kamailio-3.1/etc/kamailio/kamailio.cfg" -> this points to the config file which is in a custom path

So, it seems that when one installs kamailio in a directory other than the default path with the prefix option ['make prefix="new path here" all' and 'make prefix="new path here" install'] you have to explicitly tell it somehow to load the config file from somewhere else. Or I did not do it correctly. Can somebody please confirm?.
I thought that the initialization scripts would also take care of that. I have installed kamailio 1.4.3  1.5.0, 1.5.2 using the prefix option at 'make' time several times and never had this issue.

Again, these were my main steps:

 mkdir -p /usr/local/src/kamailio-3.1.0
cd /usr/local/src/kamailio-3.1.0

git clone --depth 1 git://git.sip-router.org/sip-router kamailio
cd kamailio
git checkout -b 3.1 origin/3.1

mkdir /usr/local/kamailio-3.1

make FLAVOUR=kamailio cfg

vi modules.lst to exclude db_mysql db_odbc from modules.lst 

make PREFIX="/usr/local/kamailio-3.1/" all
make PREFIX="/usr/local/kamailio-3.1/" install


then I executed /usr/local/kamailio-3.1/sbin/kamdbctl create to create the DB and tables.



From: fborot at hotmail.com
To: sr-users at lists.sip-router.org
Date: Fri, 24 Jun 2011 18:10:38 -0400
Subject: Re: [SR-Users] kamailio fails to start with kamctl start









I enabled debugging on the kamctl script and see these lines right before it fails:

+ minfo 'Starting Kamailio : '
+ '[' -t 1 -a -z '' ']'
+ echo -e '\E[37;33m\033[1mINFO: Starting Kamailio : \033[0m'
INFO: Starting Kamailio :
+ '[' -r /var/run/kamailio.pid ']'
+ '[' '!' -x ./kamailio ']'
+ '[' 1 = 1 ']'
+ ./kamailio -P /var/run/kamailio.pid
+ sleep 3
+ '[' '!' -s /var/run/kamailio.pid ']'
+ echo

+ merr 'PID file /var/run/kamailio.pid does not exist -- Kamailio start failed'
+ '[' -t 1 -a -z '' ']'
+ echo -e '\E[37;31m\033[1mERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed\033[0m'
ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed
+ exit 1
[root at registrar sbin]#


these are the main steps I followed to install it:

mkdir -p /usr/local/src/kamailio-3.1.0
cd /usr/local/src/kamailio-3.1.0

git clone --depth 1 git://git.sip-router.org/sip-router kamailio
cd kamailio
git checkout -b 3.1 origin/3.1

mkdir /usr/local/kamailio-3.1

make FLAVOUR=kamailio cfg

vi modules.lst to exclude db_mysql db_odbc from modules.lst 

make PREFIX="/usr/local/kamailio-3.1/" all
make PREFIX="/usr/local/kamailio-3.1/" install


then I executed /usr/local/kamailio-3.1/sbin/kamdbctl create to create the DB and tables.



From: fborot at hotmail.com
To: sr-users at lists.sip-router.org
Date: Fri, 24 Jun 2011 16:28:28 -0400
Subject: [SR-Users] kamailio fails to start with kamctl start








Hello
I just installed kamailio-3.1 and using the default config file "kamctl start" fails


 [root at registrar sbin]# ./kamctl start

INFO: Starting Kamailio :

ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed
[root at registrar sbin]# 

but when I use this command it starts: <kamailio -f path_to_config_file

[root at registrar sbin]# ./kamailio -f /usr/local/kamailio-3.1/etc/kamailio/kamailio.cfg
loading modules under /usr/local/kamailio-3.1//lib64/kamailio/modules_k/:/usr/local/kamailio-3.1//lib64/kamailio/modules/
Listening on
             udp: 127.0.0.1:5060
             udp: 192.168.168.10:5060
             tcp: 127.0.0.1:5060
             tcp: 192.168.168.10:5060
Aliases:
             tcp: localhost:5060
             tcp: localhost.localdomain:5060
             tcp: registrar:5060
             tcp: registrar.mytestdomain.com:5060
             udp: localhost:5060
             udp: localhost.localdomain:5060
             udp: registrar:5060
             udp: registrar.mytestdomain.com:5060

[root at registrar sbin]#

Also, when I use "./kamctl start" the syslog file does not show anything at all that would help me why it is failing. 
But when I use "/usr/local/kamailio-3.1/sbin/kamailio -f /usr/local/kamailio-3.1/etc/kamailio/kamailio.cfg" it does update the syslog file.

Also, after kamailio start with "./kamailio -f .." I can use ./kamctl fifo <any option>. Example:

[root at registrar sbin]# ./kamctl fifo version
Server:: kamailio (3.1.4 (x86_64/linux))
Build:: mi_core.c compiled on 15:09:40 Jun 24 2011 with gcc 4.1.2
Flags:: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
GIT:: e2d6f0
[root at registrar sbin]#

[root at registrar sbin]# ./kamctl fifo ps
Process::  ID=0 PID=27078 Type=attendant
Process::  ID=1 PID=27079 Type=udp receiver child=0 sock=127.0.0.1:5060
Process::  ID=2 PID=27080 Type=udp receiver child=1 sock=127.0.0.1:5060
Process::  ID=3 PID=27081 Type=udp receiver child=2 sock=127.0.0.1:5060
Process::  ID=4 PID=27082 Type=udp receiver child=3 sock=127.0.0.1:5060
Process::  ID=5 PID=27083 Type=udp receiver child=0 sock=192.168.168.10:5060
Process::  ID=6 PID=27084 Type=udp receiver child=1 sock=192.168.168.10:5060
Process::  ID=7 PID=27085 Type=udp receiver child=2 sock=192.168.168.10:5060
Process::  ID=8 PID=27086 Type=udp receiver child=3 sock=192.168.168.10:5060
Process::  ID=9 PID=27087 Type=slow timer
Process::  ID=10 PID=27088 Type=timer
Process::  ID=11 PID=27089 Type=MI FIFO
Process::  ID=12 PID=27090 Type=ctl handler
Process::  ID=13 PID=27091 Type=tcp receiver child=0
Process::  ID=14 PID=27092 Type=tcp receiver child=1
Process::  ID=15 PID=27093 Type=tcp receiver child=2
Process::  ID=16 PID=27094 Type=tcp receiver child=3
Process::  ID=17 PID=27095 Type=tcp main process
[root at registrar sbin]#



 		 	   		  

_______________________________________________
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 		 	   		  

_______________________________________________
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 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110627/d9a08196/attachment-0001.htm>


More information about the sr-users mailing list