--- a/prosody Thu Feb 17 01:41:57 2022 +0100
+++ b/prosody Tue Jan 01 16:42:52 2019 +0100
@@ -78,18 +78,6 @@
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");
-
-prosody.log("debug", "Shutdown reason was: %s", prosody.shutdown_reason or "not specified");
-prosody.log("debug", "Exiting with status code: %d", prosody.shutdown_code or 0);
-os.exit(prosody.shutdown_code, true);
+startup.shutdown();
--- a/util/startup.lua Thu Feb 17 01:41:57 2022 +0100
+++ b/util/startup.lua Tue Jan 01 16:42:52 2019 +0100
@@ -624,6 +624,22 @@
end
end
+function startup.cleanup()
+ prosody.log("info", "Shutdown status: Cleaning up");
+ prosody.events.fire_event("server-cleanup");
+end
+
+function startup.shutdown()
+ prosody.log("info", "Shutting down...");
+ startup.cleanup();
+ prosody.events.fire_event("server-stopped");
+ prosody.log("info", "Shutdown complete");
+
+ prosody.log("debug", "Shutdown reason was: %s", prosody.shutdown_reason or "not specified");
+ prosody.log("debug", "Exiting with status code: %d", prosody.shutdown_code or 0);
+ os.exit(prosody.shutdown_code);
+end
+
-- prosodyctl only
function startup.prosodyctl()
prosody.process_type = "prosodyctl";