From 11dbc0b49af73253a2cd76baaff24561c0cfbb0b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 10 Nov 2012 23:39:22 +0100 Subject: mod_posix: Remove console and stdout logging sinks before daemonizing --- plugins/mod_posix.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins') 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); -- cgit v1.2.3