1
0
Fork 0
mirror of https://github.com/bjc/prosody.git synced 2025-04-05 06:07:37 +03:00

mod_posix: Remove console and stdout logging sinks before daemonizing

This commit is contained in:
Kim Alvefur 2012-11-10 23:39:22 +01:00
parent b7219c57f4
commit 37ba438ad9

View file

@ -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);