X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=8fcee8e840e45f795f9bd64ed0a22861352c7df4;hb=e6f233991726b10bbeb7b418e1d8bfbee41c1d2c;hp=1a0f6ff2d76119f7907785187a94e0541be72079;hpb=db5688d8546c1387ece50f3ae76c3434367d6c12;p=prosody.git diff --git a/prosody b/prosody index 1a0f6ff2..8fcee8e8 100755 --- a/prosody +++ b/prosody @@ -49,9 +49,6 @@ _G.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" @@ -86,6 +83,7 @@ function read_config() break; end end + prosody.config_file = filename local ok, level, err = config.load(filename); if not ok then print("\n"); @@ -115,6 +113,12 @@ function read_config() end end +function check_dependencies() + if not dependencies.check_dependencies() then + os.exit(1); + end +end + function load_libraries() -- Load socket framework server = require "net.server" @@ -240,7 +244,7 @@ function init_global_state() function prosody.reload_config() log("info", "Reloading configuration file"); prosody.events.fire_event("reloading-config"); - local ok, level, err = config.load((rawget(_G, "CFG_CONFIGDIR") or ".").."/prosody.cfg.lua"); + local ok, level, err = config.load(prosody.config_file); if not ok then if level == "parser" then log("error", "There was an error parsing the configuration file: %s", tostring(err)); @@ -381,6 +385,7 @@ init_logging(); sanity_check(); sandbox_require(); set_function_metatable(); +check_dependencies(); load_libraries(); init_global_state(); read_version();