Re: Running Kannel 1.1.5 in backgroud

"Bruno David Rodrigues" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <019b01c1c394$4044a060$6e01290a@hobbes>
And if you DON'T detach, it's easier to loop it inside a
shell script or even put it on inittab.

That way, if some *box crash (even if it shouldn't), it's restart
automatically

As in:
/etc/inittab:
k1:23:respawn:su kannel -c /home/kannel/12345/bin/loop_bearerbox
k2:23:respawn:su kannel -c /home/kannel/12345/bin/loop_smsbox

in bin, do a symbolic link from *box to *box-12345

(having the -12345 allows me to have several kannel with different
services, and to "restart" the service with a killall bearerbox-12345 :) )

loop_bearerbox:
#!/bin/bash
cd /home/kannel/12345
while [ 1 ] ; do
        bin/bearerbox-12345 -v 9 etc/kannel.conf
        sleep 5
        bin/alert &
        sleep 5
done

loop_smsbox:
#!/bin/bash
cd /home/kannel/12345
while [ 1 ] ; do
        while [ "`pidof bearerbox-12345`" = "" ] ; do
                sleep 1
        done
        bin/smsbox-12345 -v 9 etc/kannel.conf
        sleep 5
        bin/alert &
        sleep 5
done

alert:
#!/bin/bash
#export http_proxy="http://host:port/"
bb=`pidof bearerbox-12345 | wc -w| perl -ne 's/ //g;print;'`
sb=`pidof smsbox-12345 | wc -w| perl -ne 's/ //g;print;'`

lynx -dump -source
"http://otherkannel:13013/sendsms?user=user&pass=pass&from=ALERT&to=mynumber
&mclass=1&text=Smsbox%20Down!%0ABB=$bb%0ASB=$sb"


----- Original Message -----
From: "Stipe Tolj" <[email protected]>
To: "macky" <[email protected]>
Cc: <[email protected]>
Sent: Monday, March 04, 2002 12:54 PM
Subject: Re: Running Kannel 1.1.5 in backgroud


> macky wrote:
> >
> > how do run bearerbox and smsbox  in background without  using  "&"
>
> since kannel's boxes do not detach from the initiating caller shell
> (i.e. Apache's httpd does this) you will have to use the "&" to set
> them in the background.
>
> Stipe
>
> [email protected]
> -------------------------------------------------------------------
> Wapme Systems AG
>
> Münsterstr. 248
> 40470 Düsseldorf
>
> Tel: +49-211-74845-0
> Fax: +49-211-74845-299
>
> E-Mail: [email protected]
> Internet: http://www.wapme-systems.de
> -------------------------------------------------------------------
> wapme.net - wherever you are
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.