Hello Milan,

I haven't changed anything in the code.
I've just downloaded the newest kannel_snapshot, compiled it and tried
again.

The scenario i'm performing is following:
1. Start bearerbox (testgw:/vas/bin/kannel_1.5.0_20.04.2012/sbin #
./bearerbox -v 1 /vas/config/kannel/kannel_tanja.conf)
2. Start smsbox (testgw:/vas/bin/kannel_1.5.0_20.04.2012/sbin # ./smsbox -v
1 /vas/config/kannel/kannel_tanja.conf)
3. Send SIGINT to smsbox process (smsbox process is terminated and
restarted after 10 seconds with new PID)
testgw:/vas/bin/kannel_1.5.0_20.04.2012/sbin # ./smsbox -v 1
/vas/config/kannel/kannel_tanja.conf (see bellow)
2012-04-20 14:25:36 [9535] [0] INFO: Debug_lvl = 1, log_file = <none>,
log_lvl = 0
2012-04-20 14:25:36 [9535] [0] INFO: Logging accesses to
'/vas/logs/kannel/smsboxaccess.log'.
2012-04-20 14:25:36 [9535] [0] INFO: Started access logfile
`/vas/logs/kannel/smsboxaccess.log'.
2012-04-20 14:25:36 [9535] [0] INFO: HTTP: Opening server at port 4004.
2012-04-20 14:25:36 [9535] [0] INFO: Set up send sms service at port 4004
2012-04-20 14:25:36 [9535] [0] INFO: Using HTTP request queueing with 10
retries, 60s delay.
2012-04-20 14:25:36 [9535] [0] INFO: Connected to bearerbox at localhost
port 4001.
*^C2012-04-20 14:25:41 [9535] [0] ERROR: SIGINT received, aborting
program...
2012-04-20 14:25:41 [9535] [0] ERROR: Bearerbox is gone, restarting
2012-04-20 14:25:41 [9535] [0] INFO: Received (and handled?) 0 requests in
5 seconds (0.00 per second)
2012-04-20 14:25:41 [9535] [0] INFO: Kannel smsbox terminating.
testgw:/vas/bin/kannel_1.5.0_20.04.2012/sbin # 2012-04-20 14:25:52 [9545]
[0] INFO: Debug_lvl = 1, log_file = <none>, log_lvl = 0
2012-04-20 14:25:52 [9545] [0] INFO: Logging accesses to
'/vas/logs/kannel/smsboxaccess.log'.
2012-04-20 14:25:52 [9545] [0] INFO: Started access logfile
`/vas/logs/kannel/smsboxaccess.log'.
2012-04-20 14:25:52 [9545] [0] INFO: HTTP: Opening server at port 4004.
2012-04-20 14:25:52 [9545] [0] INFO: Set up send sms service at port 4004
2012-04-20 14:25:52 [9545] [0] INFO: Using HTTP request queueing with 10
retries, 60s delay.
2012-04-20 14:25:52 [9545] [0] INFO: Connected to bearerbox at localhost
port 4001.
*
I was analyzing the smsbox.c and according to output that i get i
understand that first signal_handler is called

switch (signum) {
        case SIGINT:

               if (program_status != shutting_down) {
                error(0, "SIGINT received, aborting program...");
                program_status = shutting_down;
            }
            break;

which is OK, than (according to the output messages)
*read_messages_from_bearerbox()
*is executed. More precisely

while (program_status != shutting_down) {
        /* block infinite for reading messages */
        ret = read_from_bearerbox(&msg, INFINITE_TIME);
        if (ret == -1) {
            error(0, "Bearerbox is gone, restarting");
            program_status = shutting_down;
            restart = 1;
            break;
        } else if (ret == 1) /* timeout */
            continue;
        else if (msg == NULL) /* just to be sure, may not happens */
            break;

and this is odd because program_status was previously set to shutting_down
(by the signal_handler function).

Please note that I'm compiling and running kannel on 64bit OS. Can this be
the reason for this behavior?*
*
Thanks in advance,
Tanja
*
*

>
> Message: 2
> Date: Fri, 20 Apr 2012 13:55:16 +0200
> From: "Milan P. Stanic" <m...@arvanta.net>
> To: devel@kannel.org
> Subject: Re: After SIGINT received SMSBOX restarts (bug or a feature)
> Message-ID: <20120420115515.ga17...@arvanta.net>
> Content-Type: text/plain; charset=us-ascii
>
> On Fri, 2012-04-20 at 09:19, Tanja Kipreska wrote:
> > Hello,
> >
> > I've been testing kannel 1.5.0 for some time and I've noticed that when I
> > start smsbox from command line - ./smsbox -v 0
> > /vas/config/kannel_tanja.conf (not as daemon) , and than try to shut it
> > down by generating SIGINT signal (CTRL+C), but smsbox process restarts
> with
> > new PID. Please see output given bellow. My question is: Is this bug in
> > smsbox process or a feature (expected behavior)?
>
> I tried to start bearbox and smsbox (svn version) from command line and
> stop it with CTRL-C (SIGINT). Both works as expected.
>
> I can't see any bug in mentioned behavior, and smsbox (nor bearbox)
> doesn't have that feature.
>
> Did you changed source?
>
> > testgw:/vas/bin/kannel_1.5.0_
> > modified/sbin # ./smsbox -v 0 /vas/config/kannel_tanja.conf
> > 2012-04-19 12:01:46 [984] [0] INFO: Debug_lvl = 0, log_file = <none>,
> > log_lvl = 0
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Loading include file
> > `/vas/config/kannel/kannel_services.conf' (on line 148 of file
> >
> > /vas/config/kannel_tanja.conf).
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Kannel smsbox version `svn-r'.
> > Build `Apr 10 2012 10:37:05', compiler `4.3.4 [gcc-4_3-branch revision
> > 152973]'.
> > System Linux, release 3.0.13-0.27-default, version #1 SMP Wed Feb 15
> > 13:33:49 UTC 2012 (d73692b), machine
> >
> > x86_64.
> > Hostname testgw.one.net.mk, IP 127.0.0.2.
> > Libxml version 2.7.6.
> > Compiled with MySQL 5.5.21, using MySQL 5.5.21.
> > Using native malloc.
> >
> > 2012-04-19 12:01:46 [984] [0] INFO: Logging accesses to
> > '/vas/logs/kannel/smsboxaccess.log'.
> > 2012-04-19 12:01:46 [984] [0] INFO: Started access logfile
> > `/vas/logs/kannel/smsboxaccess.log'.
> > 2012-04-19 12:01:46 [984] [0] INFO: HTTP: Opening server at port 4004.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 1
> (gwlib/fdset.c:poller)
> > 2012-04-19 12:01:46 [984] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps
> > to pid 984.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 2
> > (gwlib/http.c:server_thread)
> > 2012-04-19 12:01:46 [984] [0] INFO: Set up send sms service at port 4004
> > 2012-04-19 12:01:46 [984] [2] DEBUG: Thread 2
> (gwlib/http.c:server_thread)
> > maps to pid 984.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 3
> > (gw/smsbox.c:sendsms_thread)
> > 2012-04-19 12:01:46 [984] [3] DEBUG: Thread 3
> (gw/smsbox.c:sendsms_thread)
> > maps to pid 984.
> > 2012-04-19 12:01:46 [984] [2] DEBUG: HTTP: Including port 4004, fd 9 for
> > polling in server thread
> > 2012-04-19 12:01:46 [984] [0] INFO: Using HTTP request queueing with 10
> > retries, 60s delay.
> > 2012-04-19 12:01:46 [984] [0] DEBUG:
> > ----------------------------------------------
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Kannel smsbox version svn-r starting
> > 2012-04-19 12:01:46 [984] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <user-allow-ip> = <*.*.*.*>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <username> = <bulk>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <password> = <bulk>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <user-allow-ip> = <localhost>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <username> = <api>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <password> = <pre456paid>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <user-allow-ip> = <*.*.*.*>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <dlr-url> =
> >
> > <http://vasgw/srvKBPrvo/dlr.php?from=%p&to=%P&value=%d&reply=%A>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <username> = <bulkdlr>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <password> = <bulkdlr>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <user-allow-ip> = <localhost>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <username> = <om>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 12:01:46 [984] [0] DEBUG:     <password> = <Trmtrm>
> > 2012-04-19 12:01:46 [984] [4] DEBUG: Thread 4
> > (gw/smsbox.c:obey_request_thread) maps to pid 984.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 4
> > (gw/smsbox.c:obey_request_thread)
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 5
> > (gw/smsbox.c:url_result_thread)
> > 2012-04-19 12:01:46 [984] [5] DEBUG: Thread 5
> > (gw/smsbox.c:url_result_thread) maps to pid 984.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 6
> > (gw/smsbox.c:http_queue_thread)
> > 2012-04-19 12:01:46 [984] [6] DEBUG: Thread 6
> > (gw/smsbox.c:http_queue_thread) maps to pid 984.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Connecting to <127.0.0.1>
> > 2012-04-19 12:01:46 [984] [0] INFO: Connected to bearerbox at localhost
> > port 4001.
> > 2012-04-19 12:01:46 [984] [0] DEBUG: Started thread 7
> > (gw/heartbeat.c:heartbeat_thread)
> > 2012-04-19 12:01:46 [984] [7] DEBUG: Thread 7
> > (gw/heartbeat.c:heartbeat_thread) maps to pid 984.
> > ^C2012-04-19 13:16:21 [984] [0] ERROR: SIGINT received, aborting
> program...
> > 2012-04-19 13:16:21 [984] [0] ERROR: Bearerbox is gone, restarting
> > 2012-04-19 13:16:21 [984] [0] INFO: Received (and handled?) 0 requests in
> > 4475 seconds (0.00 per second)
> > 2012-04-19 13:16:21 [984] [0] INFO: Kannel smsbox terminating.
> > 2012-04-19 13:16:21 [984] [7] DEBUG: Thread 7
> > (gw/heartbeat.c:heartbeat_thread) terminates.
> > 2012-04-19 13:16:21 [984] [0] DEBUG: Waiting for 2
> > (gwlib/http.c:server_thread) to terminate
> > 2012-04-19 13:16:21 [984] [3] DEBUG: HTTP: No clients with requests,
> > quitting.
> > 2012-04-19 13:16:21 [984] [3] DEBUG: Thread 3
> (gw/smsbox.c:sendsms_thread)
> > terminates.
> > 2012-04-19 13:16:21 [984] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller)
> > terminates.
> > 2012-04-19 13:16:21 [984] [2] DEBUG: Thread 2
> (gwlib/http.c:server_thread)
> > terminates.
> > 2012-04-19 13:16:21 [984] [0] DEBUG: Waiting for 4
> > (gw/smsbox.c:obey_request_thread) to terminate
> > 2012-04-19 13:16:21 [984] [4] DEBUG: Thread 4
> > (gw/smsbox.c:obey_request_thread) terminates.
> > 2012-04-19 13:16:21 [984] [6] DEBUG: Thread 6
> > (gw/smsbox.c:http_queue_thread) terminates.
> > 2012-04-19 13:16:21 [984] [0] DEBUG: Waiting for 5
> > (gw/smsbox.c:url_result_thread) to terminate
> > 2012-04-19 13:16:21 [984] [5] DEBUG: Thread 5
> > (gw/smsbox.c:url_result_thread) terminates.
> > testgw:/vas/bin/kannel_1.5.0_modified/sbin # 2012-04-19 13:16:32 [1144]
> [0]
> > INFO: Debug_lvl = 0, log_file = <none>,
> >
> > log_lvl = 0
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Loading include file
> > `/vas/config/kannel/kannel_services.conf' (on line 148 of file
> >
> > /vas/config/kannel_tanja.conf).
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Kannel smsbox version `svn-r'.
> > Build `Apr 10 2012 10:37:05', compiler `4.3.4 [gcc-4_3-branch revision
> > 152973]'.
> > System Linux, release 3.0.13-0.27-default, version #1 SMP Wed Feb 15
> > 13:33:49 UTC 2012 (d73692b), machine
> >
> > x86_64.
> > Hostname testgw.one.net.mk, IP 127.0.0.2.
> > Libxml version 2.7.6.
> > Compiled with MySQL 5.5.21, using MySQL 5.5.21.
> > Using native malloc.
> >
> > 2012-04-19 13:16:32 [1144] [0] INFO: Logging accesses to
> > '/vas/logs/kannel/smsboxaccess.log'.
> > 2012-04-19 13:16:32 [1144] [0] INFO: Started access logfile
> > `/vas/logs/kannel/smsboxaccess.log'.
> > 2012-04-19 13:16:32 [1144] [0] INFO: HTTP: Opening server at port 4004.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 1
> > (gwlib/fdset.c:poller)
> > 2012-04-19 13:16:32 [1144] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller)
> maps
> > to pid 1144.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 2
> > (gwlib/http.c:server_thread)
> > 2012-04-19 13:16:32 [1144] [0] INFO: Set up send sms service at port 4004
> > 2012-04-19 13:16:32 [1144] [2] DEBUG: Thread 2
> (gwlib/http.c:server_thread)
> > maps to pid 1144.
> > 2012-04-19 13:16:32 [1144] [2] DEBUG: HTTP: Including port 4004, fd 12
> for
> > polling in server thread
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 3
> > (gw/smsbox.c:sendsms_thread)
> > 2012-04-19 13:16:32 [1144] [0] INFO: Using HTTP request queueing with 10
> > retries, 60s delay.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:
> > ----------------------------------------------
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Kannel smsbox version svn-r
> starting
> > 2012-04-19 13:16:32 [1144] [3] DEBUG: Thread 3
> (gw/smsbox.c:sendsms_thread)
> > maps to pid 1144.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <user-allow-ip> = <*.*.*.*>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <username> = <bulk>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <password> = <bulk>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <user-allow-ip> = <localhost>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <username> = <api>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <password> = <pre456paid>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <user-allow-ip> = <*.*.*.*>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <dlr-url> =
> >
> > <http://vasgw/srvKBPrvo/dlr.php?from=%p&to=%P&value=%d&reply=%A>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <username> = <bulkdlr>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <password> = <bulkdlr>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:   dumping group (sendsms-user):
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <user-allow-ip> = <localhost>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <group> = <sendsms-user>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <max-messages> = <4>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <forced-smsc> = <smsc4.7>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <username> = <om>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <concatenation> = <1>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <split-chars> = <#!>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG:     <password> = <Trmtrm>
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 4
> > (gw/smsbox.c:obey_request_thread)
> > 2012-04-19 13:16:32 [1144] [4] DEBUG: Thread 4
> > (gw/smsbox.c:obey_request_thread) maps to pid 1144.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 5
> > (gw/smsbox.c:url_result_thread)
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 6
> > (gw/smsbox.c:http_queue_thread)
> > 2012-04-19 13:16:32 [1144] [6] DEBUG: Thread 6
> > (gw/smsbox.c:http_queue_thread) maps to pid 1144.
> > 2012-04-19 13:16:32 [1144] [5] DEBUG: Thread 5
> > (gw/smsbox.c:url_result_thread) maps to pid 1144.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Connecting to <127.0.0.1>
> > 2012-04-19 13:16:32 [1144] [0] INFO: Connected to bearerbox at localhost
> > port 4001.
> > 2012-04-19 13:16:32 [1144] [0] DEBUG: Started thread 7
> > (gw/heartbeat.c:heartbeat_thread)
> > 2012-04-19 13:16:32 [1144] [7] DEBUG: Thread 7
> > (gw/heartbeat.c:heartbeat_thread) maps to pid 1144.
>
> --
> Kind regards,  Milan
> --------------------------------------------------
> Arvanta,        http://www.arvanta.net
> Please do not send me e-mail containing HTML code or documents in
> proprietary format (word, excel, pps and so on)
>
>
>
> ------------------------------
>
> _______________________________________________
> devel mailing list
> devel@kannel.org
> http://www.kannel.org/mailman/listinfo/devel
>
>
> End of devel Digest, Vol 68, Issue 13
> *************************************
>
------------------------------

Reply via email to