Software /
code /
prosody
Diff
plugins/mod_posix.lua @ 2332:7772dde4010b
mod_posix: Catch SIGINT
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 07 Dec 2009 18:38:35 +0000 |
parent | 2074:c59c8f3ec645 |
child | 2338:2a163f6a4bc2 |
line wrap: on
line diff
--- 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