X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=5f1b49b63b8b014d706b703c247f58611ecc24f3;hb=3466a0839b83600e110b7c218c9e3f4235f0c41a;hp=49f982f38709b0d7674918c1320f6b529ee02044;hpb=732070f96201ae8eedb2561e96cdf7af78d0c5e3;p=prosody.git diff --git a/prosody b/prosody index 49f982f3..5f1b49b6 100755 --- a/prosody +++ b/prosody @@ -160,6 +160,7 @@ end -- Global function to initiate prosody shutdown function prosody_shutdown(reason) log("info", "Shutting down: %s", reason or "unknown reason"); + eventmanager.fire_event("server-stopping", { reason = reason }); server.setquitting(true); end @@ -198,6 +199,8 @@ while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do socket.sleep(0.2); end +eventmanager.fire_event("server-cleanup"); + -- Ok, we're quitting I know, but we -- need to do some tidying before we go :) server.setquitting(false); @@ -224,3 +227,5 @@ for hostname, host in pairs(hosts) do end server.closeall(); + +eventmanager.fire_event("server-stopped");