From 3d3546fa0c102325f4f28183faa368454bd5f7d8 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sat, 25 Oct 2008 11:11:25 +0000 Subject: [PATCH] Merged revisions 151906 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r151906 | russell | 2008-10-25 06:02:11 -0500 (Sat, 25 Oct 2008) | 16 lines Merged revisions 151905 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r151905 | russell | 2008-10-25 05:59:02 -0500 (Sat, 25 Oct 2008) | 8 lines 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@151907 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/asterisk.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/main/asterisk.c b/main/asterisk.c index dc6cf9cdce..652bacf10e 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3323,11 +3323,6 @@ int main(int argc, char *argv[]) ast_channels_init(); - if (init_manager()) { - printf("%s", term_quit()); - exit(1); - } - if (ast_cdr_engine_init()) { printf("%s", term_quit()); exit(1); @@ -3379,6 +3374,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("%s", term_quit()); + exit(1); + } + dnsmgr_start_refresh(); /* We might have the option of showing a console, but for now just