From 65ea2283aa141250c6c13e6081ff56ed1a520d53 Mon Sep 17 00:00:00 2001 From: Ariel Martin Date: Mon, 4 Nov 2024 17:17:08 -0300 Subject: [PATCH] fix: removes missplaced LogCritical --- src/agent/src/unix_daemon.cpp | 1 - src/agent/src/unix_daemon.hpp | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/agent/src/unix_daemon.cpp b/src/agent/src/unix_daemon.cpp index 6c9db036f3..f91f228a75 100644 --- a/src/agent/src/unix_daemon.cpp +++ b/src/agent/src/unix_daemon.cpp @@ -86,7 +86,6 @@ namespace unix_daemon if (!file.is_open()) { - LogCritical("Error opening file: {}({}) {}", filename.c_str(), errno, std::strerror(errno)); return 0; } diff --git a/src/agent/src/unix_daemon.hpp b/src/agent/src/unix_daemon.hpp index 0a1f3d5533..13faebe828 100644 --- a/src/agent/src/unix_daemon.hpp +++ b/src/agent/src/unix_daemon.hpp @@ -6,6 +6,7 @@ namespace unix_daemon { + /// @brief A class for handling PID files. class PIDFileHandler { public: @@ -25,9 +26,16 @@ namespace unix_daemon bool writePIDFile() const; bool removePIDFile() const; + /// @brief The method uses the readlink() function to read the path of the current executable file. + /// @return A string representing the current process' executable path. static std::string GetExecutablePath(); }; + /// @brief Returns the current status of the daemon. + /// @return A string representing the daemon's status. std::string GetDaemonStatus(); + + /// @brief Generates a PID file for the daemon. + /// @return A PIDFileHandler object that will delete the generated PID file on destruction (RAII style). PIDFileHandler GeneratePIDFile(); } // namespace unix_daemon