Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 02, 2020 3:43 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: /etc/init.d/a2b-callback-daemon does not stop the daemon
PostPosted: Wed Dec 23, 2009 9:48 pm 
Offline
User avatar

Joined: Mon Nov 16, 2009 9:26 pm
Posts: 30
Location: Kyiv, Ukraine
Hello,

I have a problem with callback on Debian. I have copied script A2Billing1.4.4/CallBack/callback-daemon-py/callback_daemon/a2b-callback-daemon.debian to /etc/init.d/a2b-callback-daemon. I am able to start the daemon using it but not able to stop or restart. It writes that the daemon is stopped but actually it is not stopped.

# /etc/init.d/a2b-callback-daemon stop
Stopping a2b-callback-daemon : a2b-callback-daemon:.
# ps ax | grep call
13319 pts/0 S+ 0:00 grep call
31831 ? S 0:02 /usr/bin/python /usr/bin/a2b_callback_daemon

The script content is the following:

Code:
#! /bin/sh
#
#  a2b_callback_daemon
#

NAME="a2b-callback-daemon"
DESC="A2Billing Callback Daemon"
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/a2b_callback_daemon
PIDFILE=/var/run/$NAME.pid


trap "" 1
export LANG=C
export PATH


set -e
if [ -x $DAEMON ] ; then
        HAVE_DAEMON=1
else
        echo "No $NAME installed"
        exit 0
fi

. /lib/lsb/init-functions


status() {
   plist=`ps auxw | grep "$DAEMON" | grep -v grep | awk '{print $2}' | tr '\012' ' '`
   if [ "$plist" = "" ]; then
         echo "$DESC is stopped"
         return 1
   else
         echo "$DESC is running: $plist"
         return 0
   fi
}


case "$1" in
  start)
     if status > /dev/null; then
      echo "$DESC is already running. Use restart."
      exit 0
   fi
   
     log_daemon_msg " Starting $NAME  : $NAME"
    if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON; then
       echo `ps axf | grep -v grep | grep $DAEMON | head -n1 | awk '{print $1}'` > $PIDFILE
      log_end_msg 0
   else
      log_end_msg 1
   fi
   
    ;;

  stop)
    log_daemon_msg "Stopping $NAME : $NAME"
    if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE; then
       rm -rf $PIDFILE 2> /dev/null
      log_end_msg 0
   else
      log_end_msg 1
   fi
    ;;
 
  status)
        status
        exit $?
        ;;
   
  reload-config)
    log_daemon_msg "Reloading $NAME configuration"
    if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --signal HUP --exec $DAEMON; then
      log_end_msg 0
   else
      log_end_msg 1
   fi
    ;;

  restart-daemon)
    log_daemon_msg "Restarting $NAME"
    if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --oknodo --exec $DAEMON  --retry 30; then
       rm -rf $PIDFILE 2> /dev/null
       
      if start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile $PIDFILE --exec $DAEMON; then
         echo `ps axf | grep -v grep | grep $DAEMON | head -n1 | awk '{print $1}'` > $PIDFILE
         log_end_msg 0
      else
         log_end_msg 1
      fi
      
    else
      log_end_msg 1
   fi
    ;;

  restart)
    $0 restart-daemon
    exit $?
    ;;

  *)
    log_success_msg "Usage: /etc/init.d/$NAME {start|stop|status|reload-config|restart}"
    exit 1
    ;;
esac


exit 0


Please advice what I did wrong.

Thanks.


Top
 Profile  
 
 Post subject: Re: /etc/init.d/a2b-callback-daemon does not stop the daemon
PostPosted: Sat Oct 30, 2010 6:28 pm 
Offline

Joined: Tue Oct 06, 2009 12:23 pm
Posts: 23
Location: Austria
You have to change /etc/a2billing.conf

pidfile = /var/run/a2billing/a2b-callback-daemon.pid
to
pidfile = /var/run/a2b-callback-daemon.pid

Greetings
http://bestcallshop.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group