summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-01-18 06:56:18 +0000
committerSadie Powell <sadie@witchery.services>2021-01-18 07:05:27 +0000
commita59ed4b39443eb788c15c65501898ca374387e2e (patch)
treea20c0bee867288e956d171ed733b3c7747c2a316 /src
parent8b2f3980cc8e5bfb0153981b5ca6b08ca39392c2 (diff)
Add a new runtime directory and move the pid file to it.
The data directory is intended for persistent files whereas the pid file is ephemeral. This distinction doesn't matter by default but on system-wide installs ephemeral runtime files go in /var/run or /run instead.
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp1
-rw-r--r--src/inspircd.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index f96836507..3977be25e 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -57,6 +57,7 @@ ServerConfig::ServerPaths::ServerPaths(ConfigTag* tag)
, Data(tag->getString("datadir", INSPIRCD_DATA_PATH, 1))
, Log(tag->getString("logdir", INSPIRCD_LOG_PATH, 1))
, Module(tag->getString("moduledir", INSPIRCD_MODULE_PATH, 1))
+ , Runtime(tag->getString("runtimedir", INSPIRCD_RUNTIME_PATH, 1))
{
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 5760e631b..df5dc8647 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -445,7 +445,7 @@ void InspIRCd::WritePID(const std::string& filename, bool exitonfail)
return;
}
- std::string fname = ServerInstance->Config->Paths.PrependData(filename.empty() ? "inspircd.pid" : filename);
+ std::string fname = ServerInstance->Config->Paths.PrependRuntime(filename.empty() ? "inspircd.pid" : filename);
std::ofstream outfile(fname.c_str());
if (outfile.is_open())
{