net.server_epoll: Add support for systemd socket activation
Allows creating listening sockets and accepting client connections
before Prosody starts.
This is unlike normal Prosody dynamic resource management, where ports
may added and removed at any time, and the ports defined by the config.
Weird things happen if these are closed (e.g. due to reload) so here we
prevent closing and ensure sockets are reused when opened again.
-- Enables SQL query logging
--
-- luacheck: ignore 213/uri
module:set_global();
local engines = module:shared("/*/sql/connections");
for uri, engine in pairs(engines) do
engine:debug(true);
end
setmetatable(engines, {
__newindex = function (t, uri, engine)
engine:debug(true);
rawset(t, uri, engine);
end
});
function module.unload()
setmetatable(engines, nil);
for uri, engine in pairs(engines) do
engine:debug(false);
end
end