Jalal

You can shut-down the Bearer Box using HTTP.  When the Bearer Box is shut-down 
the SMS box shuts-down.

In the core group of the config file you can set the admin-port.  Use this port 
to control the Bearer Box.  Look at “HTTP Administration” section in the User 
Guide; this will tell you how to do this.

My core group looks like this:
group = core
admin-port = 4001
smsbox-port = 4002
admin-password = foobar
<snip>

From the computer that is running Kannel, this will retrieve the Bearer Box 
status:
                http://localhost:4001/status.html
and this will shut-down the Bearer Box
                
http://localhost:4001/shutdown?password=foobar<http://10.248.132.115:4001/shutdown?password=gateway>

If you start the Bearer Box and the SMS Box with the -d (or --daemonize) switch 
then you won’t have the terminal window tied up running them.  I’m using this:
<path-to-bb>/bearerbox -v 1 -d <path-to-config>/kannel.conf
followed by:
                <path-to-sms>/smsbox -v 1 -d <path-to-config>/kannel.conf

(The -v 1 turns off debug logging.)

I’ve constructed a web-page to manage the Bearer Box through HTTP.  You might 
want to do similar.  I can post this code if people would find it useful.

Hope this helps.

Richard

From: [email protected] [mailto:[email protected]] On Behalf Of 
Jalal Uddin
Sent: 09 March 2011 08:44
To: 'Alejandro Guerrieri'
Cc: [email protected]
Subject: RE: How to stop bearerbox and smsbox

Thank you very much for the reply.

Actually I tried to kill bearerbox many times, and now I have tried it again. I 
have applied the “top” command to see the running processes. And everytime I 
kill the bearerbox, it just comes back again with a new process id. Any idea 
why this can happen. It is like something is monitoring bearerbox and whenever 
it is dead, it re creates it. You told me to use –daemonize switch, the 
documentation says that it will detach the bearerbox from terminal, so I guess 
that will free my terminal, but will that solve this issue? It seems like 
something is not letting bearerbox to be dead.

Btw, I have stopped kannel with the following command before killing the 
bearerbox, I have also killed smsbox using the killall and using kill -9 
process id, and still the bearerbox is getting back, I can’t believe this. Any 
idea what monitors bearerbox or how to stop it so that it do not restart?

Thank you.

From: Alejandro Guerrieri [mailto:[email protected]]
Sent: Wednesday, March 09, 2011 1:02 PM
To: Jalal Uddin
Cc: <[email protected]>
Subject: Re: How to stop bearerbox and smsbox

Use the --daemonize switch to detach from the console.

To kill the processes, you can identify the process id's and kill -9 them, or 
do a killall by process name.

Check the user guide for the finer details.

Anyway, I'd recommend you to use an init script, there's some examples for 
RedHat/CentOS and other distros floating around, google a little bit and you'll 
find out.

Regards,
--
Alex Guerrieri

On 09/03/2011, at 07:50, "Jalal Uddin" 
<[email protected]<mailto:[email protected]>> wrote:
Hello,
I am new with kannel. I usually run kannel (bearerbox , smsbox) from command 
prompt. Like below:

Terminal 1
$> cd /etc/kannel
$> Bearerbox kannel.conf

Terminal 2
$> cd /etc/kannel
$> Smsbox kannel.conf

And everything starts up and I can send sms from the browser using url. The 
problem is when I start kannel like that it hangs the terminal as it 
continuously listens to the service. But that is not a problem. The problem is 
when I need to shut down the server. I need to stop those two bearerbox and 
smsbox.

So say I apply Ctrl+z and they stop. Then I close the terminals, and restart 
the pc.  But after that when I try to start bearerbox and smsbox, I can’t do 
that. It says the ports are already in use. If I restart kannel (well server 
restart should do that as well I guess) it still says port is in use and 
nothing works. So I have to open kannel.conf and change the port and then again 
the bearerbox and smsbox work. Interesting is I can’t use the old ports never 
ever. So this is a problem that every time I need to change kannel.conf or 
restart kannel or server. I have to apply a brand new port. I understand this 
is very silly and should be the case. I feel like all my previous runs are 
still running in the pc. But I don’t know how to stop them and can use the same 
port next time. I have searched hard in internet but I hardly see anyone facing 
such silly problem, so I wonder what I am missing.

I will be very thankful if someone can point out what I am missing, like what 
is the perfect way to restart kannel and how can I use the previous ports again.

Thank you

Reply via email to