aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_posix.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-11-10 23:39:22 +0100
committerKim Alvefur <zash@zash.se>2012-11-10 23:39:22 +0100
commit37ba438ad9c4cc135dea4043ae57be1d929a4569 (patch)
tree9ab7954e9c92cb944b0961ed00fba1de8f0506fd /plugins/mod_posix.lua
parentb7219c57f4264a8d5655404a3c840f3113096dc8 (diff)
downloadprosody-37ba438ad9c4cc135dea4043ae57be1d929a4569.tar.gz
prosody-37ba438ad9c4cc135dea4043ae57be1d929a4569.zip
mod_posix: Remove console and stdout logging sinks before daemonizing
Diffstat (limited to 'plugins/mod_posix.lua')
-rw-r--r--plugins/mod_posix.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua
index db594ccc..ed64fc34 100644
--- a/plugins/mod_posix.lua
+++ b/plugins/mod_posix.lua
@@ -136,8 +136,16 @@ if daemonize == nil then
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()
+ remove_log_sinks();
local ok, ret = pposix.daemonize();
if not ok then
module:log("error", "Failed to daemonize: %s", ret);