kannel-init.d script

"Mary McCarter" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
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.
Until now, I was starting the kannel manually for example as
[root@kannel /]#/usr/local/gw/sbin/bearerbox xxxx
[root@kannel /]#/usr/local/gw/sbin/wapbox xxx
and all is right

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
.
[root@kannel init.d]#

I don't know why I get this error, I did all with the root.

This is my kannel.init, I only modified the BOXPATH=/usr/local/gw/sbin and 
the CONF=/usr/local/gw/conf/kannel.conf.

How can I solve this problem?
Thanks in advance

**********************************************************
#!/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 kannel \
        --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 && (
    echo -n " wapbox"
        start-stop-daemon --start --quiet \
            --pidfile $PIDFILES/kannel_wapbox.pid \
            --chuid kannel \
            --exec $BOXPATH/run_kannel_box \
            -- \
            --pidfile $PIDFILES/kannel_wapbox.pid \            
--no-extra-args \
            $BOXPATH/wapbox -v 4 -- $CONF
    )
    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 "."
    ;;

  stop)
    echo -n "Stopping WAP gateway:"
    test ! -z $START_SMSBOX && (
        echo -n " smsbox"
        start-stop-daemon --stop --retry 5 --quiet \
            --pidfile $PIDFILES/kannel_smsbox.pid \
            --exec $BOXPATH/run_kannel_box
    )
    test ! -z $START_WAPBOX && (
        echo -n " wapbox"
        start-stop-daemon --stop --retry 5 --quiet \
            --pidfile $PIDFILES/kannel_wapbox.pid \
            --exec $BOXPATH/run_kannel_box
    )
    echo -n " bearerbox"
    start-stop-daemon --stop --retry 5 --quiet \
        --pidfile $PIDFILES/kannel_bearerbox.pid \
        --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}"
    exit 1

esac

exit 0

*******************************************************************

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.  
http://join.msn.com/?page=features/junkmail
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.