On a server with Ubuntu 16.04, asterisk is installed with the dahdi module. When the server is restarted, the asterisk starts up until the dahdi is initialized. The chan_dahdi module is not loaded manually. Only by running dahdi_cfg can the module be loaded into asterisk. The question is how to make dahdi_cfg run first and then asterisk run?

    1 answer 1

    Ubuntu has download folders in various modes.

    /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d 

    5 - multi-user graphics mode, 3 - multi-user network mode (usually servers work there). The folders contain links to services (which are usually located in /etc/init.d), they are loaded in alphabetical order. In order for the service to start earlier than another, it is enough to assign the name of the link to it, which will be alphabetically used before another service.

     /etc/rc3.d ... S10dahdi_cfg -> ../init.d/dahdi_cfg* S20asterisk -> ../init.d/asterisk*