Hello I just installed kamailio-3.1 and using the default config file "kamctl start" fails
[root@registrar sbin]# ./kamctl start
INFO: Starting Kamailio :
ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed [root@registrar sbin]#
but when I use this command it starts: <kamailio -f path_to_config_file
[root@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@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@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@registrar sbin]#
[root@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@registrar sbin]#
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@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@hotmail.com To: sr-users@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@registrar sbin]# ./kamctl start
INFO: Starting Kamailio :
ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed [root@registrar sbin]#
but when I use this command it starts: <kamailio -f path_to_config_file
[root@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@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@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@registrar sbin]#
[root@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@registrar sbin]#
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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@hotmail.com To: sr-users@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@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@hotmail.com To: sr-users@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@registrar sbin]# ./kamctl start
INFO: Starting Kamailio :
ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed [root@registrar sbin]#
but when I use this command it starts: <kamailio -f path_to_config_file
[root@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@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@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@registrar sbin]#
[root@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@registrar sbin]#
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Monday 27 June 2011, Fabian Borot wrote:
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.
Hi Fabian,
I've just tested it in master branch and could reproduce it. It seems the kamctl command misses a variable inclusion in the start cmd. Not sure why it worked in 1.5 and earlier, did not tried it.
Can you please try the attached patch for the kamctl in your checkout? If you don't want to compile and install again, you could also do the changes in the installed version manually.
Best regards,
Henning
thank you Henning, I will replace the lines on the kamctl script and report back the results
From: henning.westerholt@1und1.de To: sr-users@lists.sip-router.org Subject: Re: [SR-Users] kamailio fails to start with kamctl start Date: Tue, 5 Jul 2011 18:19:10 +0200 CC: fborot@hotmail.com
On Monday 27 June 2011, Fabian Borot wrote:
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.
Hi Fabian,
I've just tested it in master branch and could reproduce it. It seems the kamctl command misses a variable inclusion in the start cmd. Not sure why it worked in 1.5 and earlier, did not tried it.
Can you please try the attached patch for the kamctl in your checkout? If you don't want to compile and install again, you could also do the changes in the installed version manually.
Best regards,
Henning
I tested it [stop, start, restart] and it worked
First I commented the line below in the kamctlrc scrip to make sure that it was working because of the change you suggested on the kamctl script and not because my workaround
STARTOPTIONS=" -f /usr/local/kamailio-3.1/etc/kamailio/kamailio.cfg"
Then I found these lines and made it like this:
if [ $SYSLOG = 1 ] ; then #$OSERBIN -P $PID_FILE $STARTOPTIONS 1>/dev/null 2>/dev/null $OSERBIN -P $PID_FILE -f $ETCDIR/kamailio.cfg $STARTOPTIONS 1>/dev/null 2>/dev/null else #$OSERBIN -P $PID_FILE -E $STARTOPTIONS $OSERBIN -P $PID_FILE -E -f $ETCDIR/kamailio.cfg $STARTOPTIONS fi sleep 3 if [ ! -s $PID_FILE ] ; then
I stoppped, started and restarted kamailio several times and it works now.
Thank you very much fborot
From: fborot@hotmail.com To: henning.westerholt@1und1.de; sr-users@lists.sip-router.org Subject: RE: [SR-Users] kamailio fails to start with kamctl start Date: Tue, 5 Jul 2011 14:10:09 -0400
thank you Henning, I will replace the lines on the kamctl script and report back the results
From: henning.westerholt@1und1.de To: sr-users@lists.sip-router.org Subject: Re: [SR-Users] kamailio fails to start with kamctl start Date: Tue, 5 Jul 2011 18:19:10 +0200 CC: fborot@hotmail.com
On Monday 27 June 2011, Fabian Borot wrote:
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.
Hi Fabian,
I've just tested it in master branch and could reproduce it. It seems the kamctl command misses a variable inclusion in the start cmd. Not sure why it worked in 1.5 and earlier, did not tried it.
Can you please try the attached patch for the kamctl in your checkout? If you don't want to compile and install again, you could also do the changes in the installed version manually.
Best regards,
Henning
On Wednesday 06 July 2011, Fabian Borot wrote:
I tested it [stop, start, restart] and it worked
First I commented the line below in the kamctlrc scrip to make sure that it was working because of the change you suggested on the kamctl script and not because my workaround
STARTOPTIONS=" -f /usr/local/kamailio-3.1/etc/kamailio/kamailio.cfg"
Then I found these lines and made it like this:
if [ $SYSLOG = 1 ] ; then #$OSERBIN -P $PID_FILE $STARTOPTIONS 1>/dev/null
2>/dev/null $OSERBIN -P $PID_FILE -f $ETCDIR/kamailio.cfg $STARTOPTIONS 1>/dev/null 2>/dev/null else #$OSERBIN -P $PID_FILE -E $STARTOPTIONS $OSERBIN -P $PID_FILE -E -f $ETCDIR/kamailio.cfg $STARTOPTIONS fi sleep 3 if [ ! -s $PID_FILE ] ; then
I stoppped, started and restarted kamailio several times and it works now.
Hi Fabian,
ok great. I'll push the fix to the master branch and 3.1 repository then.
Best regards,
Henning