aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-29 13:47:26 +0200
committerKim Alvefur <zash@zash.se>2021-07-29 13:47:26 +0200
commitcc0f3b6f24ee497b12331359cee859649208d553 (patch)
tree8659670d99eb298cbe41ea14d3e3cc31afb2be6a /tools
parentc506269ff5656772fdf739c61bf1aceac4fe9060 (diff)
downloadprosody-cc0f3b6f24ee497b12331359cee859649208d553.tar.gz
prosody-cc0f3b6f24ee497b12331359cee859649208d553.zip
migrator: Customise startup sequence to fix #1673 (Thanks acidsys)
Diverge from util.startup.prosodyctl() in order to skip unneeded behavior, such as loading the *Prosody* config file, which we do not need here, based on the `--config` flag which should point at the migrator config file instead. Notably removed: * read_config() since this loads the Prosody config * check_unwriteable() which checks logfiles specified in the Prosody config, so not relevant * make_dummy_hosts() but the migrator sets up its own hosts during migration
Diffstat (limited to 'tools')
-rw-r--r--tools/migration/prosody-migrator.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua
index 5c4800ad..a65b2141 100644
--- a/tools/migration/prosody-migrator.lua
+++ b/tools/migration/prosody-migrator.lua
@@ -35,8 +35,25 @@ end
local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua";
local startup = require "util.startup";
-startup.prosodyctl();
--- TODO startup.migrator ?
+do
+ startup.parse_args();
+ startup.init_global_state();
+ prosody.process_type = "migrator";
+ startup.force_console_logging();
+ startup.init_logging();
+ startup.init_gc();
+ startup.init_errors();
+ startup.setup_plugindir();
+ startup.setup_plugin_install_path();
+ startup.setup_datadir();
+ startup.chdir();
+ startup.read_version();
+ startup.switch_user();
+ startup.check_dependencies();
+ startup.log_startup_warnings();
+ startup.load_libraries();
+ startup.init_http_client();
+end
-- Command-line parsing
local options = {};