[asterisk-users] Debian 8.4 : dahdi startup scripts ?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Apr 19 02:48:28 CDT 2016

Thanks for your reply,

On Mon, Apr 18, 2016 at 06:25:30PM +0200, Bertrand LUPART - Linkeo.com wrote:
> Hello,
> >> I just made a asterisk / dahdi fresh install on Debian 8.4, and ended up with the following packages :
> […]
> >> However, i can't find any dahdi startup script, neither init.d neither systemd fashion.
> >> 
> >> $ sudo dpkg -l|grep -Ei 'dahdi'|cut -d " " -f3 |xargs dpkg -L|grep -E 'init.d|system'
> >> /usr/share/doc/dahdi/examples/system.conf.sample.gz
> >> /etc/init.d
> >> 
> >> 
> >> Am I missing something?
> > 
> > Yes. README.Debian[1], included as /usr/share/doc/dahdi/README.debian .
> > 
> > README.Debian (.gz, if it's long enough) is a file for some extra
> > documentation by the packager. See the section about "Automatic startup"
> > there.
> > 
> > The only real use the DAHDI init script has is for interactive module
> > loading / unloading. Modprobe is not useful on its own, as DAHDI
> > includes a set of modules (especially if you use Astribanks. There a bit
> > of extra magic besides the recursive rmmod was added).
> > 
> > Furthermore, there is really no point is removing of modules at system
> > shutdown. It only wastes time (and some CPU cycles, if you care about
> > power) and increases the chances of exposing bugs at that time.
> This startup / shutdown scheme apply to nominal cases where you don't need to reboot your system :)
> Building a brand new box may require you to restart dahdi a bunch of times:
> "no span" error [1],
> [1] http://asteriskfaqs.org/2015/01/15/asterisk-users/dahdi_genconf-fails-with-empty-configuration-no-spans.html

But as you can see from my replies there, the modules were already
loaded. All that was needed was to get the spans assigned. Unloading the
modules and loading them wouldn't have mattered.

My original plan was that if you have a blank configuration (no
/etc/dahdi/system.conf and no /etc/dahdi/assigned-spans.conf), the
spans would be generated and configured automagically at the DAHDI

Part of this works: If you have no /etc/dahdi/system.conf, when a new
span is created, dahdi_genconf creates configuration for it:


Originally this was also the case with a lack of assigned-spans.conf.
See the last hunk here:

> digium firmware not downloading [2], forgetting Europe requires E1 line mode, new telco uncertain if using crc4 …
> More, in case your telco is failing, he'll often ask you to reset on your side first. Restarting dahdi feels way more convenient than rebooting a distant system.

Again, in many cases you'll need to just use:

dahdi_span_assignment remove
dahdi_span_assignment add

This also runs dahdi_cfg on the span. Thus it already does a partial
reset. Not sure how much of a reset. If a full reset is needed, I
included the module removal and load functionality in the seperate

> Red a bunch of READMEs of the packages installed before posting, not sure i red this one. Maybe a "Manual startup / shutdown" section would be welcome ;)

Will add.

> > IIRC the Asterisk package in Jessie lacks the extra script to get the
> > configured DAHDI channels into Asterisk[2]. You may need to drop it
> > yourself to /usr/share/dahdi/span-config.d
> > 
> > If things still don't work, please do report it here on on the BTS.
> This file is missing on my side (1:, but asterisk seems to be aware of the channels. Not sure how.
> Thank you for your answer,

It's missing because it should not be part of dahdi (I removed it
explicitly in the packaging but forgot to add it to Asterisk in time for
Jessie). The DAHDI package should not assume Asterisk is installed (at
least not if it's so simple to fix).

The directory is theree for hooks to be added. If you have your own
interesting action, feel free to add it. Just make it short.

               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com

More information about the asterisk-users mailing list