X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=8fcee8e840e45f795f9bd64ed0a22861352c7df4;hb=e6f233991726b10bbeb7b418e1d8bfbee41c1d2c;hp=9a88eac0b227e65406608276a3f4e861fe78ef94;hpb=bf5f8bcb58ce13442f023d26f910ad42b970a7a3;p=prosody.git diff --git a/prosody b/prosody index 9a88eac0..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)); @@ -264,12 +268,6 @@ function init_global_state() prosody.events.fire_event("server-stopping", {reason = reason}); server.setquitting(true); end - - -- Load SSL settings from config, and create a ctx table - local certmanager = require "core.certmanager"; - local global_ssl_ctx = certmanager.create_context("*", "server"); - prosody.global_ssl_ctx = global_ssl_ctx; - end function read_version() @@ -387,6 +385,7 @@ init_logging(); sanity_check(); sandbox_require(); set_function_metatable(); +check_dependencies(); load_libraries(); init_global_state(); read_version();