projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
prosodyctl: Check that there is at least one enabled VirtualHost (or Component) defined
[prosody.git]
/
prosody
diff --git
a/prosody
b/prosody
index 9a88eac0b227e65406608276a3f4e861fe78ef94..8fcee8e840e45f795f9bd64ed0a22861352c7df4 100755
(executable)
--- a/
prosody
+++ b/
prosody
@@
-49,9
+49,6
@@
_G.prosody = prosody;
-- Check dependencies
local dependencies = require "util.dependencies";
-- 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"
-- Load the config-parsing module
config = require "core.configmanager"
@@
-86,6
+83,7
@@
function read_config()
break;
end
end
break;
end
end
+ prosody.config_file = filename
local ok, level, err = config.load(filename);
if not ok then
print("\n");
local ok, level, err = config.load(filename);
if not ok then
print("\n");
@@
-115,6
+113,12
@@
function read_config()
end
end
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"
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");
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));
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
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()
end
function read_version()
@@
-387,6
+385,7
@@
init_logging();
sanity_check();
sandbox_require();
set_function_metatable();
sanity_check();
sandbox_require();
set_function_metatable();
+check_dependencies();
load_libraries();
init_global_state();
read_version();
load_libraries();
init_global_state();
read_version();