aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2025-08-22 22:29:14 +0000
committerLiam Mitchell <[email protected]>2025-08-22 22:29:14 +0000
commitb905b6d1d94c2a09c268603935991ee3c018c700 (patch)
treeebc8885ebb627b52edbf4ab36427a571916e8d9d /src/zenserver/main.cpp
parentRemove workflow hacks for CI debugging (diff)
downloadzen-b905b6d1d94c2a09c268603935991ee3c018c700.tar.xz
zen-b905b6d1d94c2a09c268603935991ee3c018c700.zip
Move ReportServiceStatus to zenutil and remove extraneous logging
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 4ea4ee87e..e3c88f8bb 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -34,12 +34,6 @@
# include "windows/service.h"
#endif
-#if ZEN_PLATFORM_LINUX
-ZEN_THIRD_PARTY_INCLUDES_START
-# include <systemd/sd-daemon.h>
-ZEN_THIRD_PARTY_INCLUDES_END
-#endif
-
//////////////////////////////////////////////////////////////////////////
// We don't have any doctest code in this file but this is needed to bring
// in some shared code into the executable
@@ -96,43 +90,6 @@ ZenEntryPoint::ZenEntryPoint(ZenServerOptions& ServerOptions) : m_ServerOptions(
{
}
-void
-ReportServiceStatus(ServiceStatus Status)
-{
-#if ZEN_PLATFORM_WINDOWS
- switch (Status)
- {
- case ServiceStatus::Starting:
- ReportSvcStatus(SERVICE_START_PENDING, NO_ERROR, 3000);
- break;
- case ServiceStatus::Running:
- ReportSvcStatus(SERVICE_RUNNING, NO_ERROR, 0);
- break;
- case ServiceStatus::Stopping:
- ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
- break;
- case ServiceStatus::Stopped:
- ReportSvcStatus(SERVICE_STOPPED, (DWORD)ApplicationExitCode(), 0);
- break;
- default:
- break;
- }
-#elif ZEN_PLATFORM_LINUX
- switch (Status)
- {
- case ServiceStatus::Running:
- sd_notify(0, "READY=1");
- break;
- case ServiceStatus::Stopping:
- sd_notify(0, "STOPPING=1");
- break;
- case ServiceStatus::Stopped:
- sd_notifyf(0, "EXIT_STATUS=%d", ApplicationExitCode());
- break;
- }
-#endif
- (void)Status;
-}
int
ZenEntryPoint::Run()
@@ -160,11 +117,8 @@ 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();
auto NotifyReady = [&] {
@@ -238,8 +192,6 @@ ZenEntryPoint::Run()
}
}
- ZEN_INFO("Preparing lock file");
-
std::error_code Ec;
std::filesystem::path LockFilePath = m_ServerOptions.DataDir / ".lock";
@@ -253,7 +205,6 @@ ZenEntryPoint::Run()
.ExecutablePath = GetRunningExecutablePath()});
};
- ZEN_INFO("m_LockFile.Create");
m_LockFile.Create(LockFilePath, MakeLockData(false), Ec);
if (Ec)
@@ -269,7 +220,6 @@ ZenEntryPoint::Run()
}
}
- ZEN_INFO("InitializeServerLogging");
InitializeServerLogging(m_ServerOptions);
ZEN_INFO("Command line: {}", m_ServerOptions.CommandLine);