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.