Re: kannel-init.d script

"Mary McCarter" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Thank very much Bruno,

Well now I can start the bearerbox and wapbox with the init.d script. But 
I'm using the patch kwtls too, so I would like to add in the init.d kannel 
script. Well I added it, and it is almost right because it start the wapbox, 
bearerbox and the kwtls, but doesn't return me the prompt.

I get this:
[root@kannel init.d]# ./kannel start
Starting WAP gateway: bearerbox wapbox kwtls.

and I want it:
[root@kannel init.d]# ./kannel_orig start
Starting WAP gateway: bearerbox wapbox kwtls.
[root@kannel init.d]#

I start the kwtls as /usr/local/kwtls/bin/kwtls- xx.yy.zz.ff> 
/usr/local/gw/log/kwtls.log

What can I do?

Thanks in advance,
Mary

This is my script:

*****************************************************************
#!/bin/sh
# Start/stop the Kannel boxes: One bearer box and one WAP box.

# This is the default init.d script for Kannel.  Its configuration is
# appropriate for a small site running Kannel on one machine.

# Make sure that the Kannel binaries can be found in $BOXPATH or somewhere
# else along $PATH.  run_kannel_box has to be in $BOXPATH.

BOXPATH=/usr/local/gw/sbin
PIDFILES=/var/run
CONF=/usr/local/gw/conf/kannel.conf

PATH=$BOXPATH:$PATH

# On Debian, the most likely reason for the bearerbox not being available
# is that the package is in the "removed" or "unconfigured" state, and the
# init.d script is still around because it's a conffile.  This is normal,
# so don't generate any output.
test -x $BOXPATH/bearerbox || exit 0

test -r /etc/default/`basename $0` && . /etc/default/`basename $0`

case "$1" in
  start)
    echo -n "Starting WAP gateway:"
    echo -n " bearerbox"
    start-stop-daemon --start --quiet \
        --pidfile $PIDFILES/kannel_bearerbox.pid \
        --chuid root \
        --exec $BOXPATH/run_kannel_box \
        -- \
        --pidfile $PIDFILES/kannel_bearerbox.pid \
        --no-extra-args \
        $BOXPATH/bearerbox -v 4 -- $CONF
    sleep 1 # Wait for bearerbox
    #test ! -z $START_WAPBOX && (


    test ! -z $START_SMSBOX && (
    echo -n " smsbox"
        start-stop-daemon --start --quiet \
            --pidfile $PIDFILES/kannel_smsbox.pid \
            --chuid kannel \
            --exec $BOXPATH/run_kannel_box \
            -- \
            --pidfile $PIDFILES/kannel_smsbox.pid \
            --no-extra-args \
            $BOXPATH/smsbox -v 4 -- $CONF
    )
    echo "."
    ;;

  stark)
    echo -n "Start kwtls:"
     /usr/local/gw/kannelstart2.sh > kwtls.log
    echo "."
    ;;
  stop)
    echo -n "Stopping WAP gateway:"
    test ! -z $START_SMSBOX && (
        echo -n " smsbox"
        start-stop-daemon --stop  --quiet \
            --pidfile $PIDFILES/kannel_smsbox.pid \
            --exec $BOXPATH/run_kannel_box
    )
    #test ! -z $START_WAPBOX && (
        echo -n " wapbox"
        start-stop-daemon --stop  --quiet \
            --pidfile $PIDFILES/kannel_wapbox.pid \
            --exec $BOXPATH/run_kannel_box
    #)
    echo -n " bearerbox"
    start-stop-daemon --stop  --quiet \
        --pidfile $PIDFILES/kannel_bearerbox.pid \
        --exec $BOXPATH/run_kannel_box

    echo -n " kwtls"
    start-stop-daemon --stop --quiet \
    --pidfile $PIDFILES/kwtls.pid \
    --exec $BOXPATH/run_kannel_box
--exec $BOXPATH/run_kannel_box

    echo "."
    ;;

  reload)
    # We don't have support for this yet.
    exit 1
    ;;

  restart|force-reload)
    $0 stop
    sleep 1
    $0 start
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|force-reload|stark}"
    exit 1

esac

exit 0

***********************************************************
>From: Bruno Rodrigues <[email protected]>
>To: [email protected]
>Subject: Re: kannel-init.d script
>Date: 13 May 2003 01:33:51 +0100
>
>A Ter, 2003-05-13 às 01:19, Mary McCarter escreveu:
> > Hi all!
> >
> > I have a problem to start the kannel with the init.d script.
> >
> > I'm using the kannel 1.3.1, I installed the tar.gz.
> > (...)
> > But now, I want to do it in with a init.d script. When I installed it 
>with
> > the tar.gz, I didn't get this script in the /etc/init.d; So I copy the
> > script (gateway-13.1/debian/kannel.init) in the /etc/init.d
> >
> > When I try to start the kannel I get this error
> >
> > [root@kannel init.d]# ./kannel start
> > Starting WAP gateway: bearerbox/usr/local/gw/sbin/run_kannel_box: open:
> > /var/run/kannel_bearerbox.pid: Permission denied
> >(...)
> >     start-stop-daemon --start --quiet \
> >         --pidfile $PIDFILES/kannel_bearerbox.pid \
> >         --chuid kannel \
>
>That initscript will try to change to kannel user (--chuid kannel) and
>thus you need to chown kannel to /var/run/kannel and /var/log/kannel
>
>--
><br/>
>
>

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail
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.