aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-01-15 09:30:12 +0100
committerDan Engelbrecht <[email protected]>2025-01-15 09:30:12 +0100
commit531c59032bbc46bc1f7284859fa8ff8c8b5ede61 (patch)
treec06583ef275904824a9eeae42951fa6a48ebae20 /src/zenserver/main.cpp
parentclang format (diff)
downloadzen-531c59032bbc46bc1f7284859fa8ff8c8b5ede61.tar.xz
zen-531c59032bbc46bc1f7284859fa8ff8c8b5ede61.zip
systemd unit file, incomplete
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index d5419d342..6bf369ca4 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -91,6 +91,7 @@ ZenEntryPoint::ZenEntryPoint(ZenServerOptions& ServerOptions) : m_ServerOptions(
int
ZenEntryPoint::Run()
{
+ ZEN_INFO("ZenEntryPoint::Run()");
zen::SetCurrentThreadName("main");
#if ZEN_USE_SENTRY
@@ -107,8 +108,11 @@ ZenEntryPoint::Run()
try
{
// Mutual exclusion and synchronization
+ ZEN_INFO("ZenServerState ServerState");
ZenServerState ServerState;
+ ZEN_INFO("ServerState.Initialize()");
ServerState.Initialize();
+ ZEN_INFO("ServerState.Sweep()");
ServerState.Sweep();
uint32_t AttachSponsorProcessRetriesLeft = 3;
@@ -173,6 +177,8 @@ ZenEntryPoint::Run()
}
}
+ ZEN_INFO("Preparing lock file");
+
std::error_code Ec;
std::filesystem::path LockFilePath = m_ServerOptions.DataDir / ".lock";
@@ -186,6 +192,7 @@ ZenEntryPoint::Run()
.ExecutablePath = GetRunningExecutablePath()});
};
+ ZEN_INFO("m_LockFile.Create");
m_LockFile.Create(LockFilePath, MakeLockData(false), Ec);
if (Ec)
@@ -201,6 +208,7 @@ ZenEntryPoint::Run()
}
}
+ ZEN_INFO("InitializeServerLogging");
InitializeServerLogging(m_ServerOptions);
ZEN_INFO("Command line: {}", m_ServerOptions.CommandLine);
@@ -303,6 +311,11 @@ ZenEntryPoint::Run()
ZEN_CRITICAL("Caught assert exception in main for process {}: {}", zen::GetCurrentProcessId(), AssertEx.FullDescription());
RequestApplicationExit(1);
}
+ catch (const std::system_error& e)
+ {
+ ZEN_CRITICAL("Caught system error exception in main for process {}: {} ({})", zen::GetCurrentProcessId(), e.what(), e.code().value());
+ RequestApplicationExit(1);
+ }
catch (const std::exception& e)
{
ZEN_CRITICAL("Caught exception in main for process {}: {}", zen::GetCurrentProcessId(), e.what());