[Asterisk-code-review] core: Tweak startup order. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Fri Jan 26 15:14:22 CST 2018


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/8053


Change subject: core: Tweak startup order.
......................................................................

core: Tweak startup order.

Move initialization of units which do not require configuration to occur
before preload modules.  This leaves only units which load config between
module preload and regular load stages.

Change-Id: I1d15384acad16a22c3498124421af474fa517478
---
M main/asterisk.c
1 file changed, 17 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/8053/1

diff --git a/main/asterisk.c b/main/asterisk.c
index 4c7abd6..39c97d2 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -4546,20 +4546,7 @@
 	check_init(ast_device_state_engine_init(), "Device State Engine");
 	check_init(ast_presence_state_engine_init(), "Presence State Engine");
 	check_init(ast_dns_system_resolver_init(), "Default DNS resolver");
-	check_init(load_modules(1), "Module Preload");
-	check_init(ast_features_init(), "Call Features");
-	check_init(dnsmgr_init(), "DNS manager");
 	check_init(ast_security_stasis_init(), "Security Stasis Topic and Events");
-	check_init(ast_named_acl_init(), "Named ACL system");
-
-	ast_http_init();		/* Start the HTTP server, if needed */
-
-	check_init(ast_indications_init(), "Indication Tone Handling");
-	check_init(ast_cdr_engine_init(), "CDR Engine");
-
-	ast_dsp_init();
-	ast_udptl_init();
-
 	check_init(ast_image_init(), "Image");
 	check_init(ast_file_init(), "Generic File Format Support");
 	check_init(load_pbx(), "load_pbx");
@@ -4570,10 +4557,27 @@
 	check_init(load_pbx_app(), "PBX Application Support");
 	check_init(load_pbx_hangup_handler(), "PBX Hangup Handler Support");
 	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");
+
+	/* Initialize core modules that have config files.  These should be converted to
+	 * built-in modules with load priority after realtime, that way users will not
+	 * need to 'preload' realtime modules. */
+	check_init(ast_features_init(), "Call Features");
+	check_init(dnsmgr_init(), "DNS manager");
+	check_init(ast_named_acl_init(), "Named ACL system");
+	ast_http_init();
+	check_init(ast_indications_init(), "Indication Tone Handling");
+	check_init(ast_cdr_engine_init(), "CDR Engine");
+	ast_dsp_init();
+	ast_udptl_init();
 	check_init(ast_cel_engine_init(), "CEL Engine");
 	check_init(init_manager(), "Asterisk Manager Interface");
 	check_init(ast_enum_init(), "ENUM Support");
 	check_init(ast_cc_init(), "Call Completion Supplementary Services");
+
+	/* Load remaining modules */
 	check_init(load_modules(0), "Module");
 
 	/*

-- 
To view, visit https://gerrit.asterisk.org/8053
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d15384acad16a22c3498124421af474fa517478
Gerrit-Change-Number: 8053
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180126/581a078b/attachment.html>


More information about the asterisk-code-review mailing list