aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-25 10:59:02 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-25 10:59:02 +0000
commit119738bda6ec6e81084d733d0de906d42b8ed598 (patch)
tree58f92206bd5225f60c82bbd8a5ce47f9379c17ae
parent940a97ac80a6d30f968248552de6c988b2957333 (diff)
Move AMI initialization to occur after loading modules. This prevents a
deadlock when someone tries to initiate a module reload from the AMI just as Asterisk is starting. (closes issue #13778) Reported by: hotsblanc Fix suggested by hotsblanc git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@151905 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/asterisk.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index cee50d677..0a978a949 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3061,11 +3061,6 @@ int main(int argc, char *argv[])
ast_channels_init();
- if (init_manager()) {
- printf(term_quit());
- exit(1);
- }
-
if (ast_cdr_engine_init()) {
printf(term_quit());
exit(1);
@@ -3115,6 +3110,15 @@ int main(int argc, char *argv[])
exit(1);
}
+ /* AMI is initialized after loading modules because of a potential
+ * conflict between issuing a module reload from manager and
+ * registering manager actions. This will cause reversed locking
+ * order between the module list and manager actions list. */
+ if (init_manager()) {
+ printf(term_quit());
+ exit(1);
+ }
+
dnsmgr_start_refresh();
/* We might have the option of showing a console, but for now just