mirror of
https://github.com/anope/anope.git
synced 2026-07-07 05:33:13 +02:00
Add the --nopid option to disable writing a pidfile.
This is useful for init scripts that don't fork.
This commit is contained in:
+1
-1
@@ -375,7 +375,7 @@ namespace Anope
|
||||
|
||||
/** Other command line options.
|
||||
*/
|
||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
|
||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoPID, NoExpire, ProtocolDebug;
|
||||
|
||||
/** The root of the Anope installation. Usually ~/anope
|
||||
*/
|
||||
|
||||
+5
-1
@@ -221,7 +221,7 @@ static void remove_pidfile()
|
||||
static void write_pidfile()
|
||||
{
|
||||
auto pidfile = Anope::ExpandData(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid"));
|
||||
if (pidfile.empty())
|
||||
if (Anope::NoPID || pidfile.empty())
|
||||
return;
|
||||
|
||||
std::ofstream stream(pidfile.str());
|
||||
@@ -325,6 +325,7 @@ bool Anope::Init(int ac, char **av)
|
||||
Log(LOG_TERMINAL) << " --modulesdir=modules directory";
|
||||
Log(LOG_TERMINAL) << "-e, --noexpire";
|
||||
Log(LOG_TERMINAL) << "-n, --nofork";
|
||||
Log(LOG_TERMINAL) << "-p, --nopid";
|
||||
Log(LOG_TERMINAL) << " --nothird";
|
||||
Log(LOG_TERMINAL) << " --protocoldebug";
|
||||
Log(LOG_TERMINAL) << "-r, --readonly";
|
||||
@@ -352,6 +353,9 @@ bool Anope::Init(int ac, char **av)
|
||||
if (GetCommandLineArgument("nothird"))
|
||||
Anope::NoThird = true;
|
||||
|
||||
if (GetCommandLineArgument("nopid", 'p'))
|
||||
Anope::NoPID = true;
|
||||
|
||||
if (GetCommandLineArgument("noexpire", 'e'))
|
||||
Anope::NoExpire = true;
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
|
||||
/* Command-line options: */
|
||||
int Anope::Debug = 0;
|
||||
bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoExpire = false, Anope::ProtocolDebug = false;
|
||||
bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoPID = false, Anope::NoExpire = false, Anope::ProtocolDebug = false;
|
||||
Anope::string Anope::ServicesDir;
|
||||
Anope::string Anope::ServicesBin;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user