[asterisk-users] ztdummy does not load properly at server startup

Theo Band theo.band at xanadu-wireless.com
Thu Apr 19 12:17:56 MST 2007


Matthew J. Roth wrote:
> 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
The make install already did that for me .
>
>
> 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
Yes it works indeed thanks. It turns out that (for me) the "modprobe
ztdummy" alone works as well. I do get an error message as shown before,
but both ztummy and zaptel get loaded and Meetme() works. The 15 seconds
delay would add to the boot time....
I also tried the suggestion of Eric Wieling. Appearantly make config is
what I had not done. This creates the needed module load scripts. The
module remove scripts do not work properly, but who cares if the machine
is going down anyway?
>
> Things will differ depending on your distribution, but that should be
> enough to get you going in the right direction.
Yep it did :-)



More information about the asterisk-users mailing list