Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 23, 2024 11:12 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: a2billing-callback-daemon stop
PostPosted: Sat Sep 29, 2007 6:58 am 
Offline

Joined: Sat Sep 29, 2007 12:37 am
Posts: 3
I useing trixbox 2.2 with a2billing1.3. Now,i have a problem:
Code:
[root@asterisk1 callback-daemon]# service a2billing-callback-daemon start
Starting a2billing-callback-daemon:                        [  OK  ]
[root@asterisk1 callback-daemon]# service a2billing-callback-daemon status
a2billing-callback-daemon is stopped
[root@asterisk1 callback-daemon]#


The a2billing log:
Code:
[2007-09-28 6:45:49] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-09-28 6:45:50] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-09-28 6:45:59] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-09-28 6:46:00] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **


Who can help me.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 29, 2007 12:32 pm 
Offline

Joined: Mon Jun 19, 2006 5:14 pm
Posts: 218
this should:
http://forum.asterisk2billing.org/viewt ... ice+status


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 29, 2007 12:33 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
It seems the rc script supplied doesn't correctly report if the daemon is running or not, and also it looks like it will fail to kill it when asked to stop the service.

Looking at the timestamps in that logfile I would say you currently have two instances of the callback daemon running.

if you:
Code:
tail -F /var/log/asterisk/a2billing-daemon-callback.log

you should see 1 new line every tens seconds. I think you're going to see 2 in quick succession.

If you:
Code:
pidof -x a2billing-callback-daemon
it should return a list of PIDs of the running instances of the daemon. Kill one of them.

We shall have to look at getting both this SysV init script, and the Gentoo init script fixed in this regard.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 30, 2007 2:59 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Yep. You are right. And sometimes, if you restart your server, the daemon do not start automatically whether it is started before or after other dependent daemon like mysql daemon.

Anyway, I have modified the rc script for gentoo and it is working perfectly for me. It detects when it is already started and when you stop it or zap it, it behave as expected.

I will submit it to the trac tonight.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 30, 2007 3:36 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I look forward to that, asiby. It will save me the bother. 8)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 4:23 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Hi

Sorry for the delay.

Here is my version of it:

Code:
#!/sbin/runscript

#
# copy this script in /etc/init.d/a2bcallback
#

depend() {
        need net logger asterisk
        after mysql
}

start() {
        ebegin "Starting A2B Callback"
        /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon start > /dev/null 2>&1
        touch /var/lock/subsys/a2billing-callback
        eend $? "Failed to start A2B Callback"
}

stop() {
        ebegin "Stopping A2B Callback"
        /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon stop > /dev/null 2>&1
        sleep 1
        killall -q -9 a2billing-callback-daemon > /dev/null 2>&1
        rm -f /var/lock/subsys/a2billing-callback
        eend $? "Failed to stop A2B Callback"
}


On Gentoo, you need to use rc-update, rc-status, and rc-config to manage this kind of start-up scripts.

For example,

Code:
rc-config add your_script default


will add your_script to the default runlevel.

Notice that I have made sure that the script will be executed after mysql has be started. Without that, the daemon was generating some errors and was aborting execution.

Let me know if this is working for you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 11:11 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Asiby, I took the liberty of adding 'postgres' to the 'after' clause and pushed this change into svn. The experience on Gentoo is now flawless as far as I can tell.

Has anyone looked at the SysV init script to see why it incorrectly reports status, and seems to permit launching more than one copy of the daemon? I don't currently have anything other than Gentoo available to me for testing.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 5:01 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Thanks Stravos.

Just a wild guess about SysV init script. When Gentoo was having the same problem, I had noticed that the pid file was not present on the system even with the daemon running. I have to mcGiver my way around it by creating one.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 11 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group