diff options
| author | 2024-12-10 14:02:40 +0000 | |
|---|---|---|
| committer | 2024-12-10 14:02:40 +0000 | |
| commit | 173f88f08496b2b8e833a13d0122c00ec51421db (patch) | |
| tree | b9574813e3e69357d4efa45ce77d6f2065a5b833 /src/inspircd.cpp | |
| parent | Update utfcpp. (diff) | |
Write the pid file earlier to avoid a crash.
{fmt} gets angry if we try to write to a closed stdout.
Diffstat (limited to 'src/inspircd.cpp')
| -rw-r--r-- | src/inspircd.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 0f568e1f4..a4bb478b0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -504,6 +504,9 @@ InspIRCd::InspIRCd(int argc, char** argv) Exit(EXIT_FAILURE); } + // We only do this on boot because we might not be able to after dropping root. + WritePID(); + // If we don't have a SID, generate one based on the server name and the server description if (Config->ServerId.empty()) Config->ServerId = UIDGenerator::GenerateSID(Config->ServerName, Config->ServerDesc); @@ -591,7 +594,6 @@ InspIRCd::InspIRCd(int argc, char** argv) QueryPerformanceFrequency(&this->Stats.BootCPU); #endif - WritePID(); DropRoot(); Logs.Normal("STARTUP", "Startup complete as '{}'[{}], {} max open sockets", Config->ServerName, |
