Diff

plugins/mod_posix.lua @ 5178:fa6d61f2fe20

Merge 0.9 -> trunk
author Kim Alvefur <zash@zash.se>
date Sun, 11 Nov 2012 23:48:38 +0100
parent 5177:add9ad38208e
child 5450:cc83b1a50fde
line wrap: on
line diff
--- a/plugins/mod_posix.lua	Wed Oct 24 19:56:22 2012 +0200
+++ b/plugins/mod_posix.lua	Sun Nov 11 23:48:38 2012 +0100
@@ -136,8 +136,17 @@
 	end
 end
 
+local function remove_log_sinks()
+	local lm = require "core.loggingmanager";
+	lm.register_sink_type("console", nil);
+	lm.register_sink_type("stdout", nil);
+	lm.reload_logging();
+end
+
 if daemonize then
 	local function daemonize_server()
+		module:log("info", "Prosody is about to detach from the console, disabling further console output");
+		remove_log_sinks();
 		local ok, ret = pposix.daemonize();
 		if not ok then
 			module:log("error", "Failed to daemonize: %s", ret);