Mon, 07 Dec 2009 18:38:35 +0000
mod_posix: Catch SIGINT
plugins/mod_posix.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/mod_posix.lua Mon Dec 07 18:32:50 2009 +0000 +++ b/plugins/mod_posix.lua Mon Dec 07 18:38:35 2009 +0000 @@ -146,4 +146,11 @@ prosody.reload_config(); prosody.reopen_logfiles(); end); + + signal.signal("SIGINT", function () + module:log("info", "Received SIGINT"); + prosody.unlock_globals(); + prosody.shutdown("Received SIGINT"); + prosody.lock_globals(); + end); end