aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-17 12:42:01 +0200
committerGitHub Enterprise <[email protected]>2024-04-17 12:42:01 +0200
commitc956e958e0a386f24e6865ad62ee4fe640f93b18 (patch)
tree96a2d52c5e33e9af76d36535b0c675d56b685617 /src/zencore/include
parentgc v2 disk freed space fix and oplog stats report improvement (#45) (diff)
downloadzen-c956e958e0a386f24e6865ad62ee4fe640f93b18.tar.xz
zen-c956e958e0a386f24e6865ad62ee4fe640f93b18.zip
zen startup hardening (#49)
- Feature: `zen up` command improvements - --`port` allows you to specify a base port when starting an instance - --`base-dir` allows you to specify a base directory for the zenserver executable if it is not located next to the zen.exe executable - Feature: `zen down` - --`port` allows you to specify a base port when shutting down an instance - --`base-dir` allows you to specify a base directory for the zenserver executable if it is not located next to the zen.exe executable - --`force` if regular shutdown fails it tries to find a running zenserver.exe process and terminate it - If it fails to attach to the running server it now waits for it to exit when setting the RequestExit shared memory flag - Improvement: zenserver now checks the RequestExit flag in the shared memory and exist gracefully if it is set - Improvement: When adding a sponsor process to a running zenserver instance, we wait for it to be picked up from the shared memory section to determine success/fail
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/process.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h
index a14aa5a71..6dce2d264 100644
--- a/src/zencore/include/zencore/process.h
+++ b/src/zencore/include/zencore/process.h
@@ -28,7 +28,7 @@ public:
ZENCORE_API [[nodiscard]] bool IsValid() const;
ZENCORE_API bool Wait(int TimeoutMs = -1);
ZENCORE_API int WaitExitCode();
- ZENCORE_API void Terminate(int ExitCode);
+ ZENCORE_API bool Terminate(int ExitCode);
ZENCORE_API void Reset();
[[nodiscard]] inline int Pid() const { return m_Pid; }
@@ -91,9 +91,12 @@ private:
};
ZENCORE_API bool IsProcessRunning(int pid);
+ZENCORE_API bool IsProcessRunning(int pid, std::error_code& OutEc);
ZENCORE_API int GetCurrentProcessId();
int GetProcessId(CreateProcResult ProcId);
+std::error_code FindProcess(const std::filesystem::path& ExecutableImage, ProcessHandle& OutHandle);
+
void process_forcelink(); // internal
} // namespace zen