0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

construct/ircd: Add option to soft-indicate no modules should be loaded on startup.

This commit is contained in:
Jason Volk 2018-03-16 19:03:09 -07:00
parent 7daef82218
commit af8835aa5c
4 changed files with 14 additions and 0 deletions

View file

@ -53,6 +53,7 @@ lgetopt opts[] =
{ "console", &cmdline, lgetopt::BOOL, "Drop to a command line immediately after startup" },
{ "execute", &execute, lgetopt::STRING, "Execute command lines immediately after startup" },
{ "nolisten", &ircd::nolisten, lgetopt::BOOL, "Normal execution but without listening sockets" },
{ "noautomod", &ircd::noautomod, lgetopt::BOOL, "Normal execution but without autoloading modules" },
{ nullptr, nullptr, lgetopt::STRING, nullptr },
};

View file

@ -186,6 +186,7 @@ namespace ircd
extern const std::string &config;
extern bool debugmode; ///< Toggle; available only ifdef RB_DEBUG
extern bool nolisten; ///< Init option to not bind listener socks.
extern bool noautomod; ///< Option to not load modules on init.
std::string demangle(const std::string &symbol);
template<class T> std::string demangle();

View file

@ -23,6 +23,7 @@ namespace ircd
ctx::ctx *main_context; // Main program loop
bool debugmode; // meaningful ifdef RB_DEBUG
bool nolisten; // indicates no listener binding
bool noautomod; // no module loading on init
void set_runlevel(const enum runlevel &);
void at_main_exit() noexcept;

View file

@ -137,6 +137,17 @@ catch(const m::error &e)
void
ircd::m::init::modules()
{
if(ircd::noautomod)
{
log::warning
{
"Not loading modules because noautomod flag is set. "
"You may still load modules manually."
};
return;
}
const string_view prefixes[]
{
"s_", "m_", "client_", "key_", "federation_", "media_"