aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-11 22:24:34 +0200
committerKim Alvefur <zash@zash.se>2021-09-11 22:24:34 +0200
commit97aa610a42dd563d6e23c84de13550997f036cd6 (patch)
tree4059dba4c8210cb1cf0dab36ae0f2c72792d8e98
parent0d7d6b628c150b2c4cfca20b000a0ab854fda87e (diff)
downloadprosody-97aa610a42dd563d6e23c84de13550997f036cd6.tar.gz
prosody-97aa610a42dd563d6e23c84de13550997f036cd6.zip
util.prosodyctl.check: Refuse to do ojn test unless prosody is running
Other tests don't require a running prosody and I forgot to start it when testing.
-rw-r--r--util/prosodyctl/check.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index d0d7a683..472ca4ce 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -1,6 +1,7 @@
local configmanager = require "core.configmanager";
local show_usage = require "util.prosodyctl".show_usage;
local show_warning = require "util.prosodyctl".show_warning;
+local is_prosody_running = require "util.prosodyctl".isrunning;
local dependencies = require "util.dependencies";
local socket = require "socket";
local jid_split = require "util.jid".prepped_split;
@@ -723,6 +724,14 @@ local function check(arg)
end
-- intentionally not doing this by default
if what == "connectivity" then
+ print(is_prosody_running())
+ local ok, prosody_is_running = is_prosody_running();
+ if configmanager.get("*", "pidfile") and not prosody_is_running then
+ print("Prosody does not appear to be running, which is required for this test.");
+ print("Start it and then try again.");
+ return 1;
+ end
+
for host in it.filter(skip_bare_jid_hosts, enabled_hosts()) do
local modules, component_module = modulemanager.get_modules_for_host(host);
if component_module then