Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | util: Prefix module imports with prosody namespace | Kim Alvefur | 2023-03-17 | 1 | -39/+39 |
| | |||||
* | Merge 0.12->trunk | Kim Alvefur | 2023-01-22 | 1 | -1/+1 |
|\ | |||||
| * | util.startup: Close state on exit to ensure GC finalizers are called | Kim Alvefur | 2023-01-22 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ensures a last round of garbage collection and that finalizers are called. Fixes things like proper closing of SQLite3 state. There are more calls to os.exit() but most of them exit with an error or in a case where a final GC sweep might not matter as much. It would be nice if this was the default. Calling util.statup.exit() everywhere may be sensible, but would be more involved, requiring imports everywhere. | ||||
* | | util.mathcompat: Module to ease reuse of math.type() | Kim Alvefur | 2022-10-20 | 1 | -10/+1 |
| | | | | | | | | | | Mostly to ensure it is available during tests, as util.startup is not invoked there | ||||
* | | util.startup: Provide a common Lua 5.3+ math.type() for Lua 5.2 | Kim Alvefur | 2022-10-19 | 1 | -0/+14 |
|/ | | | | Code deduplication | ||||
* | util.startup: Ensure import() is available in prosodyctl (thanks keyzer) | Kim Alvefur | 2022-10-20 | 1 | -1/+1 |
| | | | | | Fixes error in mod_authz_internal due to import() being unavailable as it was only loaded in Prosody proper | ||||
* | util.startup: Fix async waiting for last shutdown steps | Kim Alvefur | 2022-06-14 | 1 | -1/+5 |
| | | | | | | | | | | | Observed problem: When shutting down prosody would immediately exit after waiting for s2s connections to close, skipping the last cleanup events and reporting the exit reason and code. This happens because prosody.main_thread is in a waiting state and queuing startup.shutdown is dispatched trough the main loop via nexttick, but since the main loop was no longer running at that point it proceeded to the end of the prosody script and exited there. | ||||
* | util.startup: Show error for unrecognized arguments passed to 'prosody' ↵ | Matthew Wild | 2022-03-21 | 1 | -6/+13 |
| | | | | (fixes #1722) | ||||
* | prosody: Move last cleanup and shutdown code into util.startup | Kim Alvefur | 2019-01-01 | 1 | -0/+16 |
| | |||||
* | util.startup: Enable DANE in http client library with use_dane | Kim Alvefur | 2022-02-05 | 1 | -0/+1 |
| | |||||
* | util.startup: Teach prosodyctl to be completely --silent | Kim Alvefur | 2021-11-28 | 1 | -0/+3 |
| | |||||
* | util.startup: Teach prosodyctl to be --quiet as complement to --verbose | Kim Alvefur | 2021-11-28 | 1 | -1/+7 |
| | | | | | | | | Original motivation was tiresome warnings about Lua 5.4 not being supported yet. Can still be handy to tweak log level, e.g. to prevent logging to interfere with command output. | ||||
* | util.startup: Allow supplying an argument parsing settings | Kim Alvefur | 2022-01-09 | 1 | -2/+2 |
| | | | | | | The 'prosody' global is not global this early so there was no way to override the process type field or argument parsing settings from outside, e.g. from the migrator. | ||||
* | util.startup: Initialize util.async at startup | Matthew Wild | 2021-11-29 | 1 | -0/+9 |
| | |||||
* | util.startup: Integrate util.promise with net.server main loop | Kim Alvefur | 2019-01-05 | 1 | -0/+8 |
| | |||||
* | util.startup: Understand -h, -? as --help in prosodyctl but ignore | Kim Alvefur | 2021-10-25 | 1 | -1/+1 |
| | | | | | prosodyctl -h showing an error was not very helpful, especially since prosodyctl shows its help for any unknown (or none) command. | ||||
* | util.startup: Show brief usage on `prosody -h|-?|--help` | Kim Alvefur | 2021-10-25 | 1 | -1/+8 |
| | | | | | Seems more suitable than asking if prosodyctl was meant to be used, or going ahead and starting. | ||||
* | util.startup: Skip config readability check in migrator (thanks eTaurus) | Kim Alvefur | 2021-10-23 | 1 | -1/+1 |
| | | | | | | This field is empty for reasons when invoked by prosody-migrator, which threw an error: > bad argument #1 to 'open' (string expected, got nil) | ||||
* | util.startup: Only ask if 'prosodyctl' was meant instead of 'prosody' (fix ↵ | Kim Alvefur | 2021-10-12 | 1 | -1/+3 |
| | | | | #1692) | ||||
* | util.startup: Allow separate command line argument settings for prosody and ↵ | Kim Alvefur | 2021-09-30 | 1 | -6/+11 |
| | | | | | | | prosodyctl Makes it clearer that prosody does not take -v atm, as well as how prosodyctl does not take the demonization flags. | ||||
* | prosodyctl: Add support for -v/--verbose to enable debug logging | Kim Alvefur | 2021-09-30 | 1 | -2/+4 |
| | | | | More convenient than the environment variable. | ||||
* | Merge 0.11->trunk | Matthew Wild | 2021-05-13 | 1 | -1/+7 |
|\ | |||||
| * | util.startup: Set more aggressive defaults for GC | Matthew Wild | 2021-05-07 | 1 | -1/+7 |
| | | | | | | | | | | | | | | | | | | Testing has demonstrated that the default GC parameters are not sufficient to prevent runaway memory growth when running under Lua 5.2 and Lua 5.3. Setting the GC speed to 500 was tested on Lua versions 5.1->5.4 and did not display unbounded memory growth. | ||||
| * | util.startup: Configure the GC on startup, using the config or built-in defaults | Matthew Wild | 2020-06-15 | 1 | -0/+17 |
| | | |||||
* | | util.startup: Make installer_plugin_path relative to data directory | Kim Alvefur | 2021-01-24 | 1 | -3/+2 |
| | | | | | | | | | | | | Having it relative to current working directory is problematic since this depends on how Prosody was started and changes to the data directory during startup (but after this point). | ||||
* | | util.startup: Don't create installer plugin path (as root) | Kim Alvefur | 2021-01-24 | 1 | -2/+0 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since this runs before dropping root, the directory ends up being owned by root, resulting in luarocks failing to install anything, since by then it would be running as the prosody user. luarocks creates this directory if needed, so creating it during startup is not necessary. One potential issue is if the directory is somewhere where Prosody can't write, but then you will simply have to create it yourself with the appropriate permissions. | ||||
* | | util.startup: Handle missing nparams field from debug info (not present in 5.1) | Matthew Wild | 2020-10-11 | 1 | -2/+3 |
| | | |||||
* | | util.startup: Include arguments in function string representation | Kim Alvefur | 2020-10-09 | 1 | -2/+8 |
| | | | | | | | | | | | | | | Improves usability of the console when digging around the internals. No specific rationale for the function<file:line>(args) format, it looked best of the variants I tried. | ||||
* | | util.startup: Retrieve less data for function string representation | Kim Alvefur | 2020-10-09 | 1 | -1/+1 |
| | | | | | | | | debug.getinfo(f) collects more info than what is needed here. | ||||
* | | util.startup: Save the path used by the installer to prosody.paths | Kim Alvefur | 2020-10-07 | 1 | -0/+1 |
| | | | | | | | | | | | | Makes it easier for other parts of the code to use this for things, such as determining whether a certain module is from this path or from elsewhere. | ||||
* | | util.startup: Fix startup failure if CFG_DATADIR is unset | Kim Alvefur | 2020-10-05 | 1 | -1/+1 |
| | | | | | | | | As is normal when running from source | ||||
* | | util.startup: Re-enable installer path setup | Kim Alvefur | 2020-10-05 | 1 | -2/+2 |
| | | |||||
* | | util.startup: Put 'installer_plugin_path' under data directory by default | Kim Alvefur | 2020-10-05 | 1 | -1/+1 |
| | | | | | | | | | | Fixes issue where it ends up creating this in $PWD, which might be ~prosody, ~you or /, depending on how it's invoked. | ||||
* | | util.startup: Init util.error with defaults if none given | Matthew Wild | 2020-08-28 | 1 | -1/+1 |
| | | |||||
* | | util.error: Allow optional tracebacks to be injected on errors | Matthew Wild | 2020-08-28 | 1 | -0/+6 |
| | | | | | | | | This allows extra debug info to be provided for development purposes. | ||||
* | | Merge 0.11->trunk | Kim Alvefur | 2020-06-23 | 1 | -1/+0 |
|\| | |||||
| * | util.startup: Remove duplicated initialization of logging (fix #1527) | Kim Alvefur | 2020-06-22 | 1 | -1/+0 |
| | | |||||
* | | util.argparse: Move exiting and error to util.startup | Kim Alvefur | 2020-06-17 | 1 | -1/+11 |
| | | | | | | | | | | | | | | | | It's not so nice to have a library that exits the entire application from under you, so this and the error reporting belongs in util.startup. The argparse code was originally in util.startup but moved out in 1196f1e8d178 but the error handling should have stayed. | ||||
* | | util.startup: Configure the GC on startup, using the config or built-in defaults | Matthew Wild | 2020-06-15 | 1 | -0/+17 |
| | | |||||
* | | util.startup: Break out command line argument parsing into util.argparse | Kim Alvefur | 2020-02-19 | 1 | -49/+5 |
| | | | | | | | | | | This will allow using it from other places such as prosodyctl sub-commands and plugins | ||||
* | | util.startup: expose current process type (prosody/prosodyctl) in the global ↵ | Matthew Wild | 2020-01-28 | 1 | -0/+2 |
| | | | | | | | | prosody object | ||||
* | | Merge 0.11->trunk | Matthew Wild | 2020-01-19 | 1 | -2/+1 |
|\| | |||||
| * | util.startup: Ensure prosody.opts exists even when no options provided0.11.5 | Matthew Wild | 2020-01-19 | 1 | -1/+1 |
| | | |||||
| * | util.startup: Remove accidentally-committed debugging | Matthew Wild | 2020-01-19 | 1 | -1/+0 |
| | | |||||
* | | Merge 0.11->trunk | Matthew Wild | 2020-01-19 | 1 | -37/+39 |
|\| | |||||
| * | util.startup: Fix logic to make --config work again | Matthew Wild | 2020-01-19 | 1 | -37/+39 |
| | | |||||
* | | Merge 0.11->trunk | Matthew Wild | 2020-01-19 | 1 | -6/+60 |
|\| | |||||
| * | prosody/util.startup: Switch to parse_args() for --root and --config | Matthew Wild | 2020-01-19 | 1 | -6/+6 |
| | | |||||
| * | util.startup: Add startup step for parsing command-line options | Matthew Wild | 2020-01-19 | 1 | -0/+54 |
| | | |||||
* | | util.startup: Ignore unused errno variable [luacheck] | Kim Alvefur | 2019-12-23 | 1 | -1/+1 |
| | |