[asterisk-dev] RES: [Code Review] Add a new option "require" to modules.conf to make Asterisk fail if a module does not load

Rafael Prado Rocchi prado at practis.com.br
Thu Nov 12 09:31:32 CST 2009


Olle, this is a valuable option!
I'll test it with some 3rd party modules we work here, forcing common
load errors on them, and report back.


Thank,
Rafael Prado




-----Mensagem original-----
De: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] Em nome de Olle E
Johansson
Enviada em: quinta-feira, 12 de novembro de 2009 11:46
Para: Olle E Johansson; Asterisk Developers
Assunto: [asterisk-dev] [Code Review] Add a new option "require" to
modules.conf to make Asterisk fail if a module does not load


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/426/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

If a module for some reason fail to load - compiled with the wrong build
system, failure to load required library or something else, then
Asterisk currently proceeds, regardless of configuration in
modules.conf.

This patch adds "require=<module>" and "preload-require=<module>" but
not "noload-require <module>" :-)

If the module doesn't load, Asterisk will print a message to stderr and
then exit with the status of 2, so that scripts like safe_asterisk and
similar can catch this situation. I don't want my Asterisk to run
without chan_sip - AT ALL, which is a reason for this patch.


Diffs
-----

  /trunk/configs/modules.conf.sample 229637 
  /trunk/main/asterisk.c 229637 
  /trunk/main/loader.c 229637 

Diff: https://reviewboard.asterisk.org/r/426/diff


Testing
-------

Tested with preload-require and require on my own development system and
some old modules that gives strange load errors and fail to load.

Noticed that logging to ERROR doesn't always get logged, since Asterisk
exits, so I added the fprintf(stderr,"....");


Thanks,

Olle E


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev



More information about the asterisk-dev mailing list