Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wazuh agent daemon mode #178

Open
wants to merge 7 commits into
base: enhancement/140-daemon-mode
Choose a base branch
from

Conversation

aritosteles
Copy link
Contributor

Related issue
141

Description

This PR aims to make wazuh-agent run in the background and support CLI commands start, status and stop.

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X

src/CMakeLists.txt Outdated Show resolved Hide resolved
@aritosteles aritosteles force-pushed the enhancement/140-implement-wazuh-agent-daemon-mode branch 3 times, most recently from 501b283 to f294c8e Compare September 26, 2024 17:50
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specifics of the daemonization look good! yet I think we should think a bit further how we are separating code. Having header files that are platform specific in the public include folder is a hint that something can be improved.

src/agent/include/register.hpp Outdated Show resolved Hide resolved
src/agent/src/register.cpp Outdated Show resolved Hide resolved
src/agent/src/unix_daemon.cpp Outdated Show resolved Hide resolved
@aritosteles aritosteles force-pushed the enhancement/140-implement-wazuh-agent-daemon-mode branch 2 times, most recently from d4f3f98 to 1708bb5 Compare September 26, 2024 21:21
@aritosteles aritosteles force-pushed the enhancement/140-implement-wazuh-agent-daemon-mode branch 7 times, most recently from 63e91df to 00c514b Compare October 2, 2024 21:44
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some additional comments. The one that looks like a must fix is the change in the vcpkg submodule hash.

Also, if possible, some commits are doing more than what the commit message states and some fixes could be made at the point what they are fixing was introduced.

src/CMakeLists.txt Outdated Show resolved Hide resolved
src/vcpkg Outdated Show resolved Hide resolved
src/agent/src/agent_registration.cpp Outdated Show resolved Hide resolved
src/agent/src/unix_daemon.cpp Outdated Show resolved Hide resolved
src/agent/src/unix_daemon.cpp Outdated Show resolved Hide resolved
src/agent/src/unix_daemon.cpp Outdated Show resolved Hide resolved
src/agent/src/unix_daemon.cpp Outdated Show resolved Hide resolved
src/agent/src/unix_daemon.cpp Outdated Show resolved Hide resolved
std::string password;
};

class AgentRegistration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you referring to the UnixDaemon class?

src/agent/include/unix_daemon.hpp Outdated Show resolved Hide resolved
@aritosteles aritosteles force-pushed the enhancement/140-implement-wazuh-agent-daemon-mode branch 7 times, most recently from 71c18c5 to 3d64627 Compare October 3, 2024 23:30
@aritosteles aritosteles force-pushed the enhancement/140-implement-wazuh-agent-daemon-mode branch from 3d64627 to c7ccdbb Compare October 4, 2024 15:19
@jr0me jr0me self-requested a review October 4, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Daemon Mode for UNIX-based Systems (Linux, macOS)
5 participants