mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 09:40:12 +01:00
construct/ircd: Add option to soft-indicate no listening sockets should be bound.
This commit is contained in:
parent
486ddf8c8f
commit
7daef82218
4 changed files with 14 additions and 1 deletions
|
@ -52,6 +52,7 @@ lgetopt opts[] =
|
|||
{ "debug", &ircd::debugmode, lgetopt::BOOL, "Enable options for debugging" },
|
||||
{ "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" },
|
||||
{ nullptr, nullptr, lgetopt::STRING, nullptr },
|
||||
};
|
||||
|
||||
|
|
|
@ -184,7 +184,8 @@ namespace ircd
|
|||
constexpr size_t BUFSIZE { 512 };
|
||||
extern const enum runlevel &runlevel;
|
||||
extern const std::string &config;
|
||||
extern bool debugmode; ///< Toggle; available only ifdef RB_DEBUG
|
||||
extern bool debugmode; ///< Toggle; available only ifdef RB_DEBUG
|
||||
extern bool nolisten; ///< Init option to not bind listener socks.
|
||||
|
||||
std::string demangle(const std::string &symbol);
|
||||
template<class T> std::string demangle();
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace ircd
|
|||
|
||||
ctx::ctx *main_context; // Main program loop
|
||||
bool debugmode; // meaningful ifdef RB_DEBUG
|
||||
bool nolisten; // indicates no listener binding
|
||||
|
||||
void set_runlevel(const enum runlevel &);
|
||||
void at_main_exit() noexcept;
|
||||
|
|
10
ircd/m/m.cc
10
ircd/m/m.cc
|
@ -158,6 +158,16 @@ namespace ircd::m
|
|||
void
|
||||
ircd::m::init::listeners()
|
||||
{
|
||||
if(ircd::nolisten)
|
||||
{
|
||||
log::warning
|
||||
{
|
||||
"Not listening on any addresses because nolisten flag is set."
|
||||
};
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const json::array listeners
|
||||
{
|
||||
config["listeners"]
|
||||
|
|
Loading…
Add table
Reference in a new issue