aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody16
1 files changed, 13 insertions, 3 deletions
diff --git a/prosody b/prosody
index ac623cef..253ac044 100755
--- a/prosody
+++ b/prosody
@@ -44,9 +44,19 @@ if CFG_DATADIR then
end
+-- Check before first require, to preempt the probable failure
+if _VERSION < "Lua 5.2" then
+ io.stderr:write("Prosody is no longer compatible with Lua 5.1\n")
+ io.stderr:write("See https://prosody.im/doc/depends#lua for more information\n")
+ return os.exit(1);
+end
+
+if not pcall(require, "prosody.loader") then
+ pcall(require, "loader");
+end
-local startup = require "util.startup";
-local async = require "util.async";
+local startup = require "prosody.util.startup";
+local async = require "prosody.util.async";
-- Note: it's important that this thread is not GC'd, as some C libraries
-- that are initialized here store a pointer to it ( :/ ).
@@ -73,7 +83,7 @@ local function loop()
end
local sleep = require"socket".sleep;
- local server = require "net.server";
+ local server = require "prosody.net.server";
while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do
sleep(0.2);