From cc0f3b6f24ee497b12331359cee859649208d553 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 29 Jul 2021 13:47:26 +0200 Subject: 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 --- tools/migration/prosody-migrator.lua | 21 +++++++++++++++++++-- 1 file 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 = {}; -- cgit v1.2.3