0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 15:04:10 +01:00

construct: Add program option for single user mode.

This commit is contained in:
Jason Volk 2020-01-12 18:22:47 -08:00
parent 01f248105d
commit 092cb5d804
2 changed files with 12 additions and 0 deletions

View file

@ -19,6 +19,7 @@
bool printversion;
bool cmdline;
bool quietmode;
bool single;
bool debugmode;
bool nolisten;
bool noautomod;
@ -46,6 +47,7 @@ lgetopt opts[]
{ "version", &printversion, lgetopt::BOOL, "Print version and exit" },
{ "debug", &debugmode, lgetopt::BOOL, "Enable options for debugging" },
{ "quiet", &quietmode, lgetopt::BOOL, "Suppress log messages at the terminal." },
{ "single", &single, lgetopt::BOOL, "Single user mode for maintenance and diagnostic." },
{ "console", &cmdline, lgetopt::BOOL, "Drop to a command line immediately after startup" },
{ "execute", &execute, lgetopt::STRING, "Execute command lines immediately after startup" },
{ "nolisten", &nolisten, lgetopt::BOOL, "Normal execution but without listening sockets" },
@ -438,6 +440,13 @@ enable_coredumps()
void
applyargs()
{
if(single)
{
nolisten = true;
write_avoid = true;
cmdline = true;
}
if(read_only)
ircd::read_only.set("true");

View file

@ -6,6 +6,9 @@
Start the daemon with one or more of the following program options to make it
easier to troubleshoot and perform maintenance:
- *-single* will start in "single user mode" which is a convenience combination
of *-nolisten -wa -console* options described below.
- *-nolisten* will disable the loading of any listener sockets during startup.
- *-wa* write-avoid will discourage (but not deny) writes to the database. This