Software /
code /
prosody
Comparison
tools/migration/prosody-migrator.lua @ 11728:826d57c16d1c
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
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 29 Jul 2021 13:47:26 +0200 |
parent | 10004:e057e8318130 |
child | 11729:f37cafeb75d6 |
comparison
equal
deleted
inserted
replaced
11727:f3aee8a825cc | 11728:826d57c16d1c |
---|---|
33 end | 33 end |
34 | 34 |
35 local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua"; | 35 local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua"; |
36 | 36 |
37 local startup = require "util.startup"; | 37 local startup = require "util.startup"; |
38 startup.prosodyctl(); | 38 do |
39 -- TODO startup.migrator ? | 39 startup.parse_args(); |
40 startup.init_global_state(); | |
41 prosody.process_type = "migrator"; | |
42 startup.force_console_logging(); | |
43 startup.init_logging(); | |
44 startup.init_gc(); | |
45 startup.init_errors(); | |
46 startup.setup_plugindir(); | |
47 startup.setup_plugin_install_path(); | |
48 startup.setup_datadir(); | |
49 startup.chdir(); | |
50 startup.read_version(); | |
51 startup.switch_user(); | |
52 startup.check_dependencies(); | |
53 startup.log_startup_warnings(); | |
54 startup.load_libraries(); | |
55 startup.init_http_client(); | |
56 end | |
40 | 57 |
41 -- Command-line parsing | 58 -- Command-line parsing |
42 local options = {}; | 59 local options = {}; |
43 local i = 1; | 60 local i = 1; |
44 while arg[i] do | 61 while arg[i] do |