aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody14
1 files changed, 3 insertions, 11 deletions
diff --git a/prosody b/prosody
index 3659ca55..ac623cef 100755
--- a/prosody
+++ b/prosody
@@ -54,6 +54,8 @@ local thread = async.runner();
thread:run(startup.prosody);
+prosody.main_thread = thread;
+
local function loop()
-- Error handler for errors that make it this far
local function catch_uncaught_error(err)
@@ -78,16 +80,6 @@ local function loop()
end
end
-local function cleanup()
- prosody.log("info", "Shutdown status: Cleaning up");
- prosody.events.fire_event("server-cleanup");
-end
-
loop();
-prosody.log("info", "Shutting down...");
-cleanup();
-prosody.events.fire_event("server-stopped");
-prosody.log("info", "Shutdown complete");
-
-os.exit(prosody.shutdown_code);
+startup.exit();