X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=07ec2bdbda64e8cf1a87a59028f71c91c01fea35;hb=42a779bb1721194d36573cbdf3b0ff09de88d3eb;hp=061f3781ee53904846b623a70999b0f76f18588f;hpb=c557b977b605382562289e1bb6201f18d9e23788;p=prosody.git diff --git a/prosody b/prosody index 061f3781..07ec2bdb 100755 --- a/prosody +++ b/prosody @@ -35,6 +35,12 @@ end prosody = { events = require "util.events".new(); }; local prosody = prosody; +-- Check dependencies +local dependencies = require "util.dependencies"; +if not dependencies.check_dependencies() then + os.exit(1); +end + -- Load the config-parsing module config = require "core.configmanager" @@ -71,9 +77,15 @@ function read_config() print("\n"); print("**************************"); if level == "parser" then - print("A problem occured while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); + print("A problem occured while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"..":"); + print(""); local err_line, err_message = tostring(err):match("%[string .-%]:(%d*): (.*)"); - print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); + if err:match("chunk has too many syntax levels$") then + print("An Include statement in a config file is including an already-included"); + print("file and causing an infinite loop. An Include statement in a config file is..."); + else + print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); + end print(""); elseif level == "file" then print("Prosody was unable to find the configuration file."); @@ -99,11 +111,8 @@ function init_logging() require "core.loggingmanager" end -function check_dependencies() - -- Check runtime dependencies - if not require "util.dependencies".check_dependencies() then - os.exit(1); - end +function log_dependency_warnings() + dependencies.log_warnings(); end function sandbox_require() @@ -442,13 +451,13 @@ end -- previous steps to have already been performed read_config(); init_logging(); -check_dependencies(); sandbox_require(); set_function_metatable(); load_libraries(); init_global_state(); read_version(); log("info", "Hello and welcome to Prosody version %s", prosody.version); +log_dependency_warnings(); load_secondary_libraries(); init_data_store(); init_global_protection();