Fix order of priority reading / file reading (bug #3860)
[asterisk/asterisk.git] / asterisk.c
index cb31376..8c62dca 100755 (executable)
@@ -1787,6 +1787,14 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (option_console && !option_verbose) 
+               ast_verbose("[ Reading Master Configuration ]");
+       ast_readconfig();
+
+       if (set_priority(option_highpriority)) {
+               exit(1);
+       }
+
        if (rungroup) {
                struct group *gr;
                gr = getgrnam(rungroup);
@@ -1802,9 +1810,6 @@ int main(int argc, char *argv[])
                        ast_verbose("Running as group '%s'\n", rungroup);
        }
 
-       if (set_priority(option_highpriority)) {
-               exit(1);
-       }
        if (runuser) {
                struct passwd *pw;
                pw = getpwnam(runuser);
@@ -1825,10 +1830,6 @@ int main(int argc, char *argv[])
        fflush(stdout);
 
        if (option_console && !option_verbose) 
-               ast_verbose("[ Reading Master Configuration ]");
-       ast_readconfig();
-
-       if (option_console && !option_verbose) 
                ast_verbose("[ Initializing Custom Configuration Options ]");
        /* custom config setup */
        register_config_cli();