[asterisk-users] ztdummy does not load properly at server startup
Matthew J. Roth
mroth at imminc.com
Thu Apr 19 10:19:22 MST 2007
Theo,
Unless things have changed significantly in the newer releases, you must
load zaptel prior to loading ztdummy. Additionally, the zaptel devices
are not created instantly, so after you load zaptel you must wait a few
seconds before loading ztdummy. You can perform some sort of polling if
you want to script this, but a less sophisticated method is just to
sleep for 10 or 15 seconds between the calls to modprobe.
If your goal is to start Asterisk automatically at boot, some init
scripts for different distributions are available at
<http://svn.digium.com/view/asterisk/branches/1.4/contrib/init.d/>. I'm
using Fedora, so I installed 'rc.redhat.asterisk' with chkconfig as follows:
# install -m 755 ./rc.redhat.asterisk /etc/rc.d/init.d/asterisk
# chkconfig --add asterisk
# chkconfig --list asterisk
asterisk 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Note that I made the following customizations to the script prior to
installing it:
* I don't want to run safe_asterisk, so I comment out all of the lines
that reference the SAFE_ASTERISK variable.
* I want to load ztdummy and raise the open file limit, so I add the
following lines to the start() function immediately prior to the
'daemon' statement:
modprobe zaptel > /dev/null 2> /dev/null
sleep 15
modprobe ztdummy > /dev/null 2> /dev/null
ztcfg > /dev/null 2> /dev/null
ulimit -n 65536 > /dev/null 2> /dev/null
* And add the following lines to the stop() function, immediately after
the 'RETVAL=$?' line:
rmmod ztdummy > /dev/null 2> /dev/null
rmmod zaptel > /dev/null 2> /dev/null
Things will differ depending on your distribution, but that should be
enough to get you going in the right direction.
Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer
More information about the asterisk-users
mailing list