prosodyctl: Don't display message about failing to start Prosody is daemonizing is disabled (if daemonizing is disabled then Prosody is stopped by the time control returns to prosodyctl, which then can't see Prosody running)

Thu, 28 Jan 2010 15:05:30 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 28 Jan 2010 15:05:30 +0000
changeset 2511
a81c710b1708
parent 2510
97b5ea975cb9
child 2512
d04b0eeeb954

prosodyctl: Don't display message about failing to start Prosody is daemonizing is disabled (if daemonizing is disabled then Prosody is stopped by the time control returns to prosodyctl, which then can't see Prosody running)

prosodyctl file | annotate | diff | comparison | revisions
--- a/prosodyctl	Thu Jan 28 14:56:47 2010 +0000
+++ b/prosodyctl	Thu Jan 28 15:05:30 2010 +0000
@@ -341,21 +341,23 @@
 	
 	local ok, ret = prosodyctl.start();
 	if ok then
-		local i=1;
-		while true do
-			local ok, running = prosodyctl.isrunning();
-			if ok and running then
-				break;
-			elseif i == 5 then
-				show_message("Still waiting...");
-			elseif i >= prosodyctl_timeout then
-				show_message("Prosody is still not running. Please give it some time or check your log files for errors.");
-				return 2;
+		if config.get("*", "core", "daemonize") ~= false then
+			local i=1;
+			while true do
+				local ok, running = prosodyctl.isrunning();
+				if ok and running then
+					break;
+				elseif i == 5 then
+					show_message("Still waiting...");
+				elseif i >= prosodyctl_timeout then
+					show_message("Prosody is still not running. Please give it some time or check your log files for errors.");
+					return 2;
+				end
+				socket.sleep(0.5);
+				i = i + 1;
 			end
-			socket.sleep(0.5);
-			i = i + 1;
+			show_message("Started");
 		end
-		show_message("Started");
 		return 0;
 	end
 

mercurial