]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Move the sanity check that makes sure "always fork" is not set along with the
authorRussell Bryant <russell@russellbryant.com>
Wed, 12 Nov 2008 17:29:52 +0000 (17:29 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 12 Nov 2008 17:29:52 +0000 (17:29 +0000)
console option to be after the code that reads options from asterisk.conf.
This resolves a situation where Asterisk can start taking up 100% when
misconfigured.
(Thanks to Bryce Porter (x86 on IRC) for letting me log in to his system to
 figure out what was causing the 100% CPU problem.)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156164 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index 941789b53db5353948a7128da2d6c7805eb0e896..d0f6e487be60009766a5270d23f6293af99b6699 100644 (file)
@@ -2790,11 +2790,6 @@ int main(int argc, char *argv[])
        if (ast_opt_console && !option_verbose) 
                ast_verbose("[ Booting...\n");
 
-       if (ast_opt_always_fork && (ast_opt_remote || ast_opt_console)) {
-               ast_log(LOG_WARNING, "'alwaysfork' is not compatible with console or remote console mode; ignored\n");
-               ast_clear_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK);
-       }
-
        /* For remote connections, change the name of the remote connection.
         * We do this for the benefit of init scripts (which need to know if/when
         * the main asterisk process has died yet). */
@@ -2805,10 +2800,17 @@ int main(int argc, char *argv[])
                }
        }
 
-       if (ast_opt_console && !option_verbose) 
+       if (ast_opt_console && !option_verbose) {
                ast_verbose("[ Reading Master Configuration ]\n");
+       }
+
        ast_readconfig();
 
+       if (ast_opt_always_fork && (ast_opt_remote || ast_opt_console)) {
+               ast_log(LOG_WARNING, "'alwaysfork' is not compatible with console or remote console mode; ignored\n");
+               ast_clear_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK);
+       }
+
        if (ast_opt_dump_core) {
                struct rlimit l;
                memset(&l, 0, sizeof(l));