aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-16 22:44:43 +0100
committerKim Alvefur <zash@zash.se>2016-01-16 22:44:43 +0100
commit48f8c23f4ab0e8400e20101960055eb29c4aa6f7 (patch)
treebde7b68581a288e5d3fc8a036c80502296972394 /prosody
parent69f9998d1641846399e3d2818da4fd07ae05739a (diff)
parent83e7c91e0130f27720406b87996c4c74b7cc0afe (diff)
downloadprosody-48f8c23f4ab0e8400e20101960055eb29c4aa6f7.tar.gz
prosody-48f8c23f4ab0e8400e20101960055eb29c4aa6f7.zip
Merge 0.10->trunk
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody9
1 files changed, 7 insertions, 2 deletions
diff --git a/prosody b/prosody
index a2cb0e6c..6a3b50db 100755
--- a/prosody
+++ b/prosody
@@ -272,10 +272,14 @@ function init_global_state()
end
-- Function to initiate prosody shutdown
- function prosody.shutdown(reason)
+ function prosody.shutdown(reason, code)
log("info", "Shutting down: %s", reason or "unknown reason");
prosody.shutdown_reason = reason;
- prosody.events.fire_event("server-stopping", {reason = reason});
+ prosody.shutdown_code = code;
+ prosody.events.fire_event("server-stopping", {
+ reason = reason;
+ code = code;
+ });
server.setquitting(true);
end
end
@@ -418,3 +422,4 @@ cleanup();
prosody.events.fire_event("server-stopped");
log("info", "Shutdown complete");
+os.exit(prosody.shutdown_code)