Kim Alvefur <zash@zash.se> [Sun, 24 Mar 2024 20:39:42 +0100] rev 13466
util.startup: Check root after detecting platform and reading config (thanks SigmaTel71)
Ensures that startup.detect_platform() runs so know whether to use the
POSIX method of checking the current user or something else. Also after
reading the config so we know whether the root override setting is set.
Kim Alvefur <zash@zash.se> [Sat, 23 Mar 2024 20:48:19 +0100] rev 13465
mod_posix: Move everything to util.startup
This allows greater control over the order of events.
Notably, the internal ordering between daemonization, initialization of
libunbound and setup of signal handling is sensitive.
libunbound starts a separate thread for processing DNS requests.
If this thread is started before signal handling has been set up, it
will not inherit the signal handlers and instead behave as it would have
before signal handlers were set up, i.e. cause the whole process to
immediately exit.
libunbound is usually initialized on the first DNS request, usually
triggered by an outgoing s2s connection attempt.
If daemonization happens before signals have been set up, signals may
not be processed at all.
Matthew Wild <mwild1@gmail.com> [Sun, 17 Mar 2024 10:10:24 +0000] rev 13464
mod_bosh: Set base_type on session
This fixes a traceback with mod_saslauth. Ideally we move this to util.session
at some point, though.
Kim Alvefur <zash@zash.se> [Sun, 10 Mar 2024 15:56:01 +0100] rev 13463
util.startup: Back out 598df17b8ebb
Broke signal handling again, such that an early s2s connection results
in libunbound catching signals and getting Prosody killed on e.g. SIGHUP
This returns to the situation where prosody --daemonize does not respond
to signals.
Kim Alvefur <zash@zash.se> [Wed, 06 Mar 2024 20:43:25 +0100] rev 13462
util.startup: Hook signals after daemonization
signalfds stop working with epoll after forking
hooking signals later should not affect anything
Kim Alvefur <zash@zash.se> [Wed, 06 Mar 2024 19:12:11 +0100] rev 13461
mod_pubsub: Ignore shadowed variable [luacheck]
Matthew Wild <mwild1@gmail.com> [Wed, 06 Mar 2024 17:38:21 +0000] rev 13460
mod_pubsub: Add shell commands to create and list nodes
Kim Alvefur <zash@zash.se> [Sat, 02 Mar 2024 14:14:27 +0100] rev 13459
core.features: Advertise that events are fired for SIGUSR1/2
Moved here from mod_posix since these events no longer originate there
Kim Alvefur <zash@zash.se> [Sat, 02 Mar 2024 14:08:47 +0100] rev 13458
util.startup: Fix firing of USR1/2 events
Kim Alvefur <zash@zash.se> [Sat, 02 Mar 2024 13:40:37 +0100] rev 13457
net.server: Restore epoll signalfd handling
Reverts 4a9a69659727
Kim Alvefur <zash@zash.se> [Sat, 02 Mar 2024 13:23:24 +0100] rev 13456
mod_posix: Move POSIX signal handling into util.startup to avoid race
When libunbound is initialized, it spawns a thread to work in.
In case a module initializes libunbound, e.g. by triggering a s2s
connection, Prosody would not handle signals, instead immediately quit
on e.g. the reload (SIGHUP) signal. Likely because the libunbound thread
would not have inherited the signal mask from the main Prosody thread.
Thanks Menel, riau and franck-x for reporting and help narrowing down
Kim Alvefur <zash@zash.se> [Fri, 01 Mar 2024 19:22:49 +0100] rev 13455
net.server: Disable epoll signalfd handling by default until problems resolved
Kim Alvefur <zash@zash.se> [Fri, 01 Mar 2024 19:20:45 +0100] rev 13454
net.server_epoll: Log creation of signalfd handles at noise level
To aid in tracking down signalfd-related problems
Matthew Wild <mwild1@gmail.com> [Fri, 01 Mar 2024 17:22:29 +0000] rev 13453
util.bit53: Add bnot() method
Kim Alvefur <zash@zash.se> [Wed, 28 Feb 2024 22:31:06 +0100] rev 13452
util.signal: Fail signalfd() if unable to change signal mask
By aborting early, the failure should be brought to the attention
somehow.
Kim Alvefur <zash@zash.se> [Wed, 28 Feb 2024 22:24:09 +0100] rev 13451
net.server_epoll: Log failure to hook signals
To make any such failures noticeable
Kim Alvefur <zash@zash.se> [Tue, 27 Feb 2024 17:15:36 +0100] rev 13450
Merge 0.12->trunk
Kim Alvefur <zash@zash.se> [Tue, 27 Feb 2024 17:14:16 +0100] rev 13449
net.http.files: Validate argument to setup function
Fixes error in #1765 by throwing an error earlier
Kim Alvefur <zash@zash.se> [Sat, 24 Feb 2024 17:45:50 +0100] rev 13448
mod_s2s: Comment on why we avoid hostnames in stanza bounce messages
Kim Alvefur <zash@zash.se> [Sat, 24 Feb 2024 14:35:17 +0100] rev 13447
mod_cron: Fix log format to account for float that was integer before
Kim Alvefur <zash@zash.se> [Sat, 24 Feb 2024 14:32:59 +0100] rev 13446
mod_cron: Sync Teal source with 92301fa7a673
Yeah, it's weird to have two versions. Needing more build dependencies
is also something we want to avoid, so here we are.
Kim Alvefur <zash@zash.se> [Sat, 24 Feb 2024 01:00:44 +0100] rev 13445
util.signal: Wrap signalfd in an userdatum for gc handling etc
Kim Alvefur <zash@zash.se> [Sat, 24 Feb 2024 00:20:35 +0100] rev 13444
net.server_epoll: Support hooking signals via signalfd
Handling signal events the same way as all other events makes sense and
seems safer than the signal handling just jumping around in C and
messing with Lua states.
Kim Alvefur <zash@zash.se> [Sat, 24 Feb 2024 00:05:29 +0100] rev 13443
util.signal: Add support for signalfd(2) on Linux
signalfd allows handling signal events using the same method as sockets,
via file descriptors. Thus all signal dispatch can go through the same
main event loop as everything else, removing need for thread-scary
signal handling where execution would just jump to the signal handler
regardless of the state of Lua, and needing to keep track of Lua
states/threads.
Matthew Wild <mwild1@gmail.com> [Fri, 23 Feb 2024 22:45:42 +0000] rev 13442
features: Add mod_server_info
Matthew Wild <mwild1@gmail.com> [Fri, 23 Feb 2024 21:14:14 +0000] rev 13441
mod_server_contact_info: Update to publish fields via new mod_server_info
Matthew Wild <mwild1@gmail.com> [Fri, 23 Feb 2024 21:13:10 +0000] rev 13440
mod_server_info: New module to manage the serverinfo disco extension form
This allows multiple modules to populate the form dynamically. Currently the
form is "owned" by mod_server_contact_info, which prevents other modules from
contributing to it.
A further commit will port mod_server_contact_info to use this module.
Kim Alvefur <zash@zash.se> [Fri, 23 Feb 2024 16:38:05 +0100] rev 13439
util.strbitop: Add common_prefix_bits() to Teal interface description
Kim Alvefur <zash@zash.se> [Fri, 23 Feb 2024 16:35:21 +0100] rev 13438
util.hashes: Add missing entries to Teal interface description
Also sorted to match C source
Kim Alvefur <zash@zash.se> [Fri, 23 Feb 2024 16:33:08 +0100] rev 13437
util.crypto: Update Teal interface description to match C sources
Was missing some entries.
Rearranged to match order of entries in the C source Reg table.