Comparison

util/prosodyctl/check.lua @ 11780:98ae95235775

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.
author Kim Alvefur <zash@zash.se>
date Sat, 11 Sep 2021 22:24:34 +0200
parent 11779:f4f0bdaeabd2
child 11782:d93107de52dd
comparison
equal deleted inserted replaced
11779:f4f0bdaeabd2 11780:98ae95235775
1 local configmanager = require "core.configmanager"; 1 local configmanager = require "core.configmanager";
2 local show_usage = require "util.prosodyctl".show_usage; 2 local show_usage = require "util.prosodyctl".show_usage;
3 local show_warning = require "util.prosodyctl".show_warning; 3 local show_warning = require "util.prosodyctl".show_warning;
4 local is_prosody_running = require "util.prosodyctl".isrunning;
4 local dependencies = require "util.dependencies"; 5 local dependencies = require "util.dependencies";
5 local socket = require "socket"; 6 local socket = require "socket";
6 local jid_split = require "util.jid".prepped_split; 7 local jid_split = require "util.jid".prepped_split;
7 local modulemanager = require "core.modulemanager"; 8 local modulemanager = require "core.modulemanager";
8 9
721 end 722 end
722 print("") 723 print("")
723 end 724 end
724 -- intentionally not doing this by default 725 -- intentionally not doing this by default
725 if what == "connectivity" then 726 if what == "connectivity" then
727 print(is_prosody_running())
728 local ok, prosody_is_running = is_prosody_running();
729 if configmanager.get("*", "pidfile") and not prosody_is_running then
730 print("Prosody does not appear to be running, which is required for this test.");
731 print("Start it and then try again.");
732 return 1;
733 end
734
726 for host in it.filter(skip_bare_jid_hosts, enabled_hosts()) do 735 for host in it.filter(skip_bare_jid_hosts, enabled_hosts()) do
727 local modules, component_module = modulemanager.get_modules_for_host(host); 736 local modules, component_module = modulemanager.get_modules_for_host(host);
728 if component_module then 737 if component_module then
729 modules:add(component_module) 738 modules:add(component_module)
730 end 739 end