Changeset

2332:7772dde4010b

mod_posix: Catch SIGINT
author Matthew Wild <mwild1@gmail.com>
date Mon, 07 Dec 2009 18:38:35 +0000
parents 2331:4842ce0c3be4
children 2333:ed824115becf
files plugins/mod_posix.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
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