Debian 8.4 : Dahdi Startup Scripts ?

Home » Asterisk Users » Debian 8.4 : Dahdi Startup Scripts ?
Asterisk Users 9 Comments


I just made a asterisk / dahdi fresh install on Debian 8.4, and ended up with the following packages :

$ sudo dpkg -l|grep -Ei ‘dahdi|asterisk|libpri’
ii asterisk 1:11.13.1~dfsg-2+b1 amd64 Open Source Private Branch Exchange (PBX)
ii asterisk-config 1:11.13.1~dfsg-2 all Configuration files for Asterisk ii asterisk-core-sounds-en 1.4.22-1 all asterisk PBX sound files – US English ii asterisk-core-sounds-en-gsm 1.4.22-1 all asterisk PBX sound files – en-us/gsm ii asterisk-dahdi 1:11.13.1~dfsg-2+b1 amd64 DAHDI devices support for the Asterisk PBX
ii asterisk-modules 1:11.13.1~dfsg-2+b1 amd64 loadable modules for the Asterisk PBX
ii asterisk-moh-opsound-gsm 2.03-1 all asterisk extra sound files – English/gsm ii asterisk-voicemail 1:11.13.1~dfsg-2+b1 amd64 simple voicemail support for the Asterisk PBX
ii dahdi 1: amd64 utilities for using the DAHDI kernel modules ii dahdi-firmware-nonfree 2.10.0-1 all DAHDI non-free firmware ii dahdi-linux 1: all DAHDI telephony interface – Linux userspace parts ii dahdi-modules-3.16.0-4-amd64:amd64 1: amd64 DAHDI modules for Linux (kernel 3.16.0-4-amd64)
ii dahdi-source 1: all DAHDI telephony interface – source code for kernel driver ii libpri1.4 1.4.15-1 amd64 Primary Rate ISDN specification library

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’

Am I missing something?

Thank you,

9 thoughts on - Debian 8.4 : Dahdi Startup Scripts ?

  • Hi Eric,

    Mine only contain /etc/init.d but not the dahdi script which should be inside :

    $ sudo dpkg -l dahdi ii dahdi 1: amd64 utilities for using the DAHDI kernel modules

    $ sudo dpkg -L dahdi

    $ dpkg -c /var/cache/apt/archives/dahdi_1%3a2.10.0.1-1_amd64.deb
    drwxr-xr-x root/root 0 2014-10-26 18:48 ./etc/
    drwxr-xr-x root/root 0 2014-10-26 18:48 ./etc/init.d/

    $ md5sum /var/cache/apt/archives/dahdi_1%3a2.10.0.1-1_amd64.deb

    Tried to download the package from another mirror, same md5, no init script. This is consistent with this :

    Maybe you did upgrade from another dahdi version and you kept the script from it ?

    I manually downloaded dahdi_2.5.0.1-2_amd64.deb and extracted /etc/init.d/dahdi , I hope no side effect.

    $ diff -u dahdi_files_2.5.0.1 dahdi_files_2.10.0.1
    — dahdi_files_2.5.0.1 2016-04-12 16:40:27.779886736 +0000
    +++ dahdi_files_2.10.0.1 2016-04-12 16:40:36.515886917 +0000
    @@ -1,7 +1,10 @@
    @@ -9,18 +12,18 @@
    @@ -29,6 +32,15 @@
    @@ -37,33 +49,15 @@
    @@ -77,17 +71,18 @@
    @@ -97,9 +92,12 @@

    Thank you,

    Bertrand LUPART

  • According to a last-year bug report (from me 😉 :

    “I’ll just note that in the Jessie version the preffered mode of operation would be not to use the init script at all and rely on running dahdi_cfg from a udev hook.”

    I’m not sure i understand how it’s supposed to work.

    Apparently, that’s not a way to go.

  • That must be it. I have an old /var/lib/dpkg/info/dahdi.list file that contains /etc/init.d/dahdi, so I was seeing it when I did “dpkg -L dahdi”. But you’re right, the current version doesn’t have it. Want to file a bug report or shall I?

  • It looks like the intent is to use the hotplug scripts called in

    The spans get set up at device detection time, by
    /usr/share/dahdi/dahdi_handle_device, which executes the scripts in /usr/share/dahdi/handle_device.d/

    For my (simple) setup, this will probably “just work”. I’ll try removing /etc/init.d/dahdi next time I reboot my asterisk machine.

  • 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”

    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.

    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.



  • Hello,


    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], 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.

    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 😉

    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,


    Bertrand LUPART

  • Thanks for your reply,

    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:;a=blob;f=hotplug/span_config.d/10-dahdi-cfg;hb=HEAD#l25

    Originally this was also the case with a lack of assigned-spans.conf. See the last hunk here:;a=commitdiff;h=1292ea90789aa20bff5a533141086f6ecf4f82df

    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 script.

    Will add.

    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