Comparison

plugins/mod_posix.lua @ 2074:c59c8f3ec645

mod_posix: Log warning when no_daemonize is used, and instruct on how to update config
author Matthew Wild <mwild1@gmail.com>
date Sun, 08 Nov 2009 15:25:03 +0000
parent 2073:72784ce0c0e0
child 2332:7772dde4010b
child 2793:08892e3f24bd
comparison
equal deleted inserted replaced
2073:72784ce0c0e0 2074:c59c8f3ec645
102 end 102 end
103 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker); 103 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker);
104 104
105 local daemonize = module:get_option("daemonize"); 105 local daemonize = module:get_option("daemonize");
106 if daemonize == nil then 106 if daemonize == nil then
107 daemonize = not module:get_option("no_daemonize"); --COMPAT w/ 0.5 107 local no_daemonize = module:get_option("no_daemonize"); --COMPAT w/ 0.5
108 daemonize = not no_daemonize;
109 if no_daemonize ~= nil then
110 module:log("warn", "The 'no_daemonize' option is now replaced by 'daemonize'");
111 module:log("warn", "Update your config from 'no_daemonize = %s' to 'daemonize = %s'", tostring(no_daemonize), tostring(daemonize));
112 end
108 end 113 end
109 114
110 if daemonize then 115 if daemonize then
111 local function daemonize_server() 116 local function daemonize_server()
112 local ok, ret = pposix.daemonize(); 117 local ok, ret = pposix.daemonize();