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

Mark Michelson mmichelson at digium.com
Thu Nov 12 09:46:12 CST 2009


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

Ship it!


Looks good by me! The only suggestion I have is a matter of opinion, so if you disagree I certainly understand.


/trunk/main/loader.c
<https://reviewboard.asterisk.org/r/426/#comment2906>

    It could be argued that order->required |= required; is a clearer way to express that you are trying to combine the requirement of a module to load.
    The only reason I suggest this is that I had to read the lines a few times before the comment above made sense.


- Mark


On 2009-11-12 07:46:02, Olle E Johansson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/426/
> -----------------------------------------------------------
> 
> (Updated 2009-11-12 07:46:02)
> 
> 
> 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
> 
>




More information about the asterisk-dev mailing list