mod_posix: Log warning when no_daemonize is used, and instruct on how to update config

Sun, 08 Nov 2009 15:25:03 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 08 Nov 2009 15:25:03 +0000
changeset 2074
c59c8f3ec645
parent 2073
72784ce0c0e0
child 2075
b4bfa6cb3d83

mod_posix: Log warning when no_daemonize is used, and instruct on how to update config

plugins/mod_posix.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_posix.lua	Sun Nov 08 15:10:44 2009 +0000
+++ b/plugins/mod_posix.lua	Sun Nov 08 15:25:03 2009 +0000
@@ -104,7 +104,12 @@
 
 local daemonize = module:get_option("daemonize");
 if daemonize == nil then
-	daemonize = not module:get_option("no_daemonize"); --COMPAT w/ 0.5
+	local no_daemonize = module:get_option("no_daemonize"); --COMPAT w/ 0.5
+	daemonize = not no_daemonize;
+	if no_daemonize ~= nil then
+		module:log("warn", "The 'no_daemonize' option is now replaced by 'daemonize'");
+		module:log("warn", "Update your config from 'no_daemonize = %s' to 'daemonize = %s'", tostring(no_daemonize), tostring(daemonize));
+	end
 end
 
 if daemonize then

mercurial