From ebcce68b6095ca9766641ce5dc00aae01d61de06 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 19 Jun 2026 16:25:36 +0100 Subject: Move server restart logic to the core. - Properly clean up the process with Cleanup() instead of using - DieRestart. - Use close_range on modern Linux instead of the CLOEXEC hack. --- include/inspircd.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/inspircd.h') diff --git a/include/inspircd.h b/include/inspircd.h index 470500f64..6c653f04e 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -396,6 +396,13 @@ public: [[noreturn]] static void QuickExit(int status, const std::string& reason = "", const std::string& logtype = ""); + /** Causes the server to restart after unloading modules and closing all open file descriptors. + * @param reason If non-empty then the reason the server is exiting. + * @param logtype If non-empty then the log type to log the exit reason as. + * @return If this function returns then the restart failed and the return value contains the reason why. + */ + std::string Restart(const std::string& reason = "", const std::string& logtype = ""); + /** Stores an incoming signal when received from the operating system. * @param signal The signal received from the operating system. */ -- cgit v1.3.1-10-gc9f91