- module:log("warn", "Received SIGTERM...");
- _G.unlock_globals();
- if _G.prosody_shutdown then
- _G.prosody_shutdown("Received SIGTERM");
- else
- module:log("warn", "...no prosody_shutdown(), ignoring.");
- end
- _G.lock_globals();
+ module:log("warn", "Received SIGTERM");
+ signal.signal("SIGTERM", function () end); -- Fixes us getting into some kind of loop
+ prosody.unlock_globals();
+ prosody.shutdown("Received SIGTERM");
+ prosody.lock_globals();
+ end);
+
+ signal.signal("SIGHUP", function ()
+ module:log("info", "Received SIGHUP");
+ prosody.reload_config();
+ prosody.reopen_logfiles();
+ end);
+
+ signal.signal("SIGINT", function ()
+ module:log("info", "Received SIGINT");
+ signal.signal("SIGINT", function () end); -- Fix to not loop
+ prosody.unlock_globals();
+ prosody.shutdown("Received SIGINT");
+ prosody.lock_globals();