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:
parent
b7219c57f4
commit
37ba438ad9
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue