Comparison

plugins/mod_posix.lua @ 10598:5cf481bee678 0.11

mod_posix: Support for command-line flags to override 'daemonize' config option -D / --daemonize -F / --no-daemonize
author Matthew Wild <mwild1@gmail.com>
date Sun, 19 Jan 2020 15:28:09 +0000
parent 9763:982529dd0bed
child 10599:4f655918fef1
comparison
equal deleted inserted replaced
10597:25a3c8134b0a 10598:5cf481bee678
124 syslog(level, name, format(message, ...)); 124 syslog(level, name, format(message, ...));
125 end; 125 end;
126 end 126 end
127 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker); 127 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker);
128 128
129 local daemonize = module:get_option("daemonize", prosody.installed); 129 local daemonize = prosody.opts.daemonize;
130
131 if daemonize == nil then
132 -- Fall back to config file if not specified on command-line
133 daemonize = module:get_option("daemonize", prosody.installed);
134 end
130 135
131 local function remove_log_sinks() 136 local function remove_log_sinks()
132 local lm = require "core.loggingmanager"; 137 local lm = require "core.loggingmanager";
133 lm.register_sink_type("console", nil); 138 lm.register_sink_type("console", nil);
134 lm.register_sink_type("stdout", nil); 139 lm.register_sink_type("stdout", nil);