From 092cb5d804e2e763462e8d73acf1823061ee554b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 12 Jan 2020 18:22:47 -0800 Subject: [PATCH] construct: Add program option for single user mode. --- construct/construct.cc | 9 +++++++++ doc/TROUBLESHOOTING.md | 3 +++ 2 files changed, 12 insertions(+) diff --git a/construct/construct.cc b/construct/construct.cc index cc3d1a635..353cf2977 100644 --- a/construct/construct.cc +++ b/construct/construct.cc @@ -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"); diff --git a/doc/TROUBLESHOOTING.md b/doc/TROUBLESHOOTING.md index 45306d083..b263f994b 100644 --- a/doc/TROUBLESHOOTING.md +++ b/doc/TROUBLESHOOTING.md @@ -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