loader: Fix startup issues.

* Merge the preload and load stages, use load ordering to try preload's
  first.  This fixes an issue where `preload=res_config_curl` would fail
  unless res_curl and func_curl were also preloaded.  Now it is only
  required that those modules be loaded during startup: autoload or
  regular load is good enough.
* The configuration option `require` and `preload-require` were only
  effective if the modules failed to load.  These options will now abort
  Asterisk startup if required modules fail to reach the 'Running'
  state.
* Missing or invalid 'module.conf' did not prevent startup.  Asterisk
  doesn't do anything without modules so this a fatal error.

Change-Id: Ie4176699133f0e3a823b43f90c3348677e43a5f3
This commit is contained in:
Corey Farrell
2018-07-15 14:58:15 -04:00
parent a9cef123d9
commit 49f83a7490
3 changed files with 137 additions and 54 deletions

View File

@@ -4139,10 +4139,7 @@ static void asterisk_daemon(int isroot, const char *runuser, const char *rungrou
check_init(ast_local_init(), "Local Proxy Channel Driver");
/* We should avoid most config loads before this point as they can't use realtime. */
check_init(load_modules(1), "Module Preload");
/* Load remaining modules */
check_init(load_modules(0), "Module");
check_init(load_modules(), "Module");
/*
* This has to load after the dynamic modules load, as items in the media