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

Jenkins2 asteriskteam at digium.com
Mon Jan 29 10:49:58 CST 2018


Jenkins2 has submitted this change and it was merged. ( 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(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



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: merged
Gerrit-Change-Id: I1d15384acad16a22c3498124421af474fa517478
Gerrit-Change-Number: 8053
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180129/00632227/attachment.html>


More information about the asterisk-code-review mailing list