You need to wait before bearerbox opens it's port before starting sqlbox.

Here is a simple script to achieve this:

while [ -z "$(netstat -nlp|grep bearerbox)" ]; do sleep 1; done

also I wouldn't recommend starting bearerbox / sqlbox like you're doing:

bearerbox kannel.conf &>/dev/null etc..

better use start-stop-daemon and run-kannel-box, check for kannel's init.d
script (might depend on your Linux distro though).

P.S. *ALWAYS INCLUDE [email protected] in the copy*



2012/10/8 sudhir meena <[email protected]>

>
>
> On Mon, Oct 8, 2012 at 6:40 PM, spameden <[email protected]> wrote:
>
>> You didn't post actual error from the log.
>>
>> Also it's not recommended running kannel as root - potential security
>> risk.
>>
>> If you're using sqlbox make sure when you inject MT into send_sms specify
>> sms_type=2.
>>
>>
>> 2012/10/8 sudhir meena <[email protected]>
>>
>>> Good Evening,
>>>
>>>                    When i restart kannel after bearerbox start i start
>>> sqlbox and at these time bearerbox stops , and these error comes after i
>>> add store-location in kannel.conf file. so, please help it's very important.
>>>
>>> ==========================================================
>>>
>>> Error.........
>>> [root@kannel202 sbin]# ./bearerbox kannel.conf &>/dev/null &
>>> [1] 28286
>>> [root@kannel202 sbin]# ./sqlbox sqlbox.conf &
>>> [2] 28374
>>>
>>> [1]   Exit 1                  ./bearerbox kannel.conf &>/dev/null
>>> [root@kannel202 sbin]# 2012-10-09 03:12:18 [28374] [0] ERROR: Error
>>> while gw_gethostbyname occurs.
>>> 2012-10-09 03:12:18 [28374] [0] ERROR: System error 1: Operation not
>>> permitted
>>> 2012-10-09 03:12:18 [28374] [0] ERROR: Can't find out official hostname
>>> for this host, using `kannel202' instead.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: Debug_lvl = -1, log_file = <none>,
>>> log_lvl = 0
>>> 2012-10-09 03:12:18 [28374] [0] DEBUG: Kannel sqlbox version `1.4.3'.
>>> Build `Sep  3 2012 08:16:24', compiler `4.4.6 20120305 (Red Hat
>>> 4.4.6-4)'.
>>> System Linux, release 2.6.32-279.el6.x86_64, version #1 SMP Fri Jun 22
>>> 12:19:21 UTC 2012, machine x86_64.
>>> Hostname kannel202, IP 127.0.0.1.
>>> Libxml version 2.7.6.
>>> Compiled with MySQL 5.1.61, using MySQL 5.1.61.
>>> Using native malloc.
>>>
>>> 2012-10-09 03:12:18 [28374] [0] INFO: Starting to log to file
>>> /var/log/kannel/sqlbox.log level 0
>>> 2012-10-09 03:12:18 [28374] [0] INFO: Added logfile
>>> `/var/log/kannel/sqlbox.log' with level `0'.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: Connected to server at
>>> localhost.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: server version 5.1.61,
>>> client version 5.1.61.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: Connected to server at
>>> localhost.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: server version 5.1.61,
>>> client version 5.1.61.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: Connected to server at
>>> localhost.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: server version 5.1.61,
>>> client version 5.1.61.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: Connected to server at
>>> localhost.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: server version 5.1.61,
>>> client version 5.1.61.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: Connected to server at
>>> localhost.
>>> 2012-10-09 03:12:18 [28374] [0] INFO: MYSQL: server version 5.1.61,
>>> client version 5.1.61.
>>> *2012-10-09 03:12:18 [28374] [0] DEBUG: Started thread 1
>>> (sqlbox.c:sql_to_bearerbox)
>>> 2012-10-09 03:12:18 [28374] [1] DEBUG: Thread 1
>>> (sqlbox.c:sql_to_bearerbox) maps to pid 28374.
>>> 2012-10-09 03:12:18 [28374] [1] ERROR: connect failed
>>> 2012-10-09 03:12:18 [28374] [1] ERROR: System error 111: Connection
>>> refused
>>> 2012-10-09 03:12:18 [28374] [1] ERROR: error connecting to server
>>> `localhost' at port `13007'
>>> 2012-10-09 03:12:18 [28374] [1] DEBUG: Thread 1
>>> (sqlbox.c:sql_to_bearerbox) terminates.*
>>>
>>>
>>>
>>>
>>> ==========================================================
>>>
>>> kannel.conf
>>>
>>> group = core
>>> admin-port = 13000
>>> admin-password = Kannel@123
>>> status-password = status
>>> smsbox-port = 13007
>>> dlr-storage = mysql
>>> box-deny-ip = "*.*.*.*"
>>> box-allow-ip = "127.0.0.1;192.168.1.*"
>>> store-type = file
>>> store-location = "/backup/kannel"
>>> #store-location = "/backup/kannel1"
>>> sms-incoming-queue-limit = -1
>>> log-level = 0
>>> access-log = /var/log/kannel/bearerbox.access
>>> log-file = /var/log/kannel/bearerbox.log
>>>
>>> group = smsbox
>>> smsbox-id = sqlbox
>>> bearerbox-host = localhost
>>> bearerbox-port = 13007
>>> sendsms-port = 13131
>>> log-file = "/var/log/kannel/smsbox.log"
>>> access-log = /var/log/kannel/smsbox.access
>>> log-level = 0
>>>
>>> #include = "Normal.conf"
>>> #include = "smsc2.conf"
>>> #include = "dnd.conf"
>>> #include = "smsc1.conf"
>>> #include = "bal.conf"
>>> #include = "Priority.conf"
>>> #include = "Pritalna.conf"
>>> #include = "TM.conf"
>>> #include = "dndspecial.conf"
>>> #include = "lnpl.conf"
>>> #include = "PMU.conf"
>>> #include = "PM1.conf"
>>> #include = "TM1.conf"
>>> #include = "TM.conf"
>>> #include = "TMU.conf"
>>> include = "smsc.conf"
>>>
>>> group = sendsms-user
>>> #dlr_url = "http://leads.emailservice.co.in/dlr.aspx?id=1&status=4";
>>> username = "doza"
>>> password = "india"
>>> #concatenation = true
>>> max-messages = 5
>>>
>>> group = mysql-connection
>>> id = sqlbox-db
>>> host = localhost
>>> username = root
>>> password = redhat
>>> database = sms_dlr
>>> max-connections = 5
>>>
>>> group = dlr-db
>>> id = sqlbox-db
>>> table = kannel_dlr
>>> field-smsc = smsc
>>> field-timestamp = ts
>>> field-destination = destination
>>> field-source = source
>>> field-service = service
>>> field-url = url
>>> field-mask = mask
>>> field-status = status
>>> field-boxc-id = boxc
>>>
>>> group = sms-service
>>> keyword = default
>>> #keyword-regex = .*
>>> catch-all = true
>>> max-messages = 0
>>> text = "No service specified"
>>>
>>> group = modems
>>> id = wavecom
>>> name = "Wavecom"
>>> #detect-string = "Wavecom"
>>> detect-string = "wavecom"
>>> #detect-string2 = ""
>>> init-string = "ATZ"
>>> init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
>>> message-storage = "SM"
>>>
>>
>>>
>>> Thank You.
>>>
>>
>>
>

Reply via email to