Re: Kannel quits without reporting fatal error

Andreas Fink <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
On Dienstag, Juli 8, 2003, at 11:13  Uhr, Alan McNatty wrote:

> Hello,
>
> run_kannel_box is a strange beast (at least to me). It's purpose seems
> unclear (or more appropriately 'undocumented'). I understand it's part
> of the utils directory (out of main source) but it is part of standard
> build (eg: debian packages).
>
> Andres could you explain a bit about what it's function is .. the man
> page is brief. I have yet to review source code in detail - but if it's
> supposed to restarting failed services I would be interested in doing
> some work/testing with it (potentially adding syslog support to begin
> with).

run_kannel_box starts up a process (either bearerbox, webbox or smsbox) 
and make's sure that if it fails, it gets restartet.

Here's how I start kannel on my computer from /etc/rc.d/init.d/kannel. 
I let the processes run as user "kannel" at the same time:


RUN=/var/run/kannel
BIN=/usr/local/sbin
DELAY="1"
CONF="/etc/kannel.conf"

RUNBOX="${BIN}/run_kannel_box"
BEARERBOX="${BIN}/bearerbox"
SMSBOX="${BIN}/smsbox"
WAPBOX="${BIN}/wapbox"

PID_SMSBOX="$RUN/smsbox.pid"
PID_BEARERBOX="$RUN/bearerbox.pid"
PID_WAPBOX="$RUN/wapbox.pid"

echo "Starting bearerbox"
su -c "${RUNBOX} --pidfile ${PID_BEARERBOX} --min-delay ${DELAY} 
${BEARERBOX} ${CONF} &" kannel
sleep 10

echo "Starting smsbox"
su -c "${RUNBOX} --pidfile ${PID_SMSBOX} --min-delay ${DELAY} ${SMSBOX} 
${CONF} &" kannel
sleep 10

echo "Starting wapbox"
su -c "${RUNBOX} --pidfile ${PID_WAPBOX} --min-delay ${DELAY} ${WAPBOX} 
${CONF} &" kannel


if you start a kannel box process with run_kannel_box it will keep the 
process restarting if it fails.
Try it yourself and try to kill any of the box processes, and you will 
see they restart. pretty much like safe_mysqld in mysql.
to kill the processes, I kill the process of the PID file above which 
is the corresponding run_kannel_box process.





Andreas Fink
Global Networks Switzerland AG

------------------------------------------------------------------
Tel: +41-61-6666333  Fax: +41-61-6666334   Mobile: +41-79-2457333
Global Networks, Inc. Clarastrasse 3, 4058 Basel, Switzerland
Web: http://www.global-networks.ch/      [email protected]
------------------------------------------------------------------
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.