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

Create Installation Packages for Wazuh Agent #128

Open
4 of 5 tasks
Tracked by #126
vikman90 opened this issue Sep 11, 2024 · 2 comments · Fixed by #182 or #200
Open
4 of 5 tasks
Tracked by #126

Create Installation Packages for Wazuh Agent #128

vikman90 opened this issue Sep 11, 2024 · 2 comments · Fixed by #182 or #200
Assignees
Labels
level/task Task issue module/packages Agent packages type/enhancement Enhancement issue

Comments

@vikman90
Copy link
Member

vikman90 commented Sep 11, 2024

Parent Issue:

Description

This issue focuses on creating platform-specific packages (RPM, DEB, MSI, PKG) to facilitate the installation of the Wazuh agent across supported operating systems. The packages should integrate with the native package managers and follow best practices for each platform.

Functional Requirements

  • Linux: Create RPM and DEB packages to install the Wazuh agent on RHEL-based and Debian-based distributions.
  • Windows: Create an MSI installer for the Wazuh agent.
  • macOS: Create a PKG installer for macOS 14+.

Subtasks

  • Linux (RPM) Package Creation #133
    • Develop an RPM spec file for RHEL, CentOS, Fedora, and similar distributions.
  • Linux (DEB) Package Creation #143
    • Create a DEB package for Debian-based distributions (Ubuntu, Debian, etc.).
  • Windows (MSI) Installer Creation #134
    • Develop an MSI installer for Windows.
    • Ensure the installer correctly registers the agent as a Windows Service.
    • Handle dependencies and any required installation scripts (pre/post-install).
  • macOS (PKG) Installer Creation #135
    • Develop a PKG installer for macOS.
    • Ensure the installer sets up the agent as a launch daemon.
    • Handle installation-related tasks like setting up permissions and configuring files.
  • Documentation:
    • Create installation instructions for each type of package (RPM, DEB, MSI, PKG).
    • Provide troubleshooting guidelines for package-related issues.
@mjcr99
Copy link
Member

mjcr99 commented Oct 16, 2024

Update

(16/10/2024) Added option to run make install and let every built file in the desired folder based on the building environment. We are waiting for this development to complete the service installation:

Currently, the installation only places the following file:

Install the project...
-- Install configuration: "RelWithDebInfo"
-- Up-to-date: /usr/local/bin/wazuh-agent

(16/10/2024) Improved path setting and added option to modify it.

@lchico
Copy link
Member

lchico commented Oct 22, 2024

Update

  • I have been working on the following issues:
[ 98%] Building CXX object CMakeFiles/wazuh-agent.dir/agent/src/main.cpp.o
[100%] Linking CXX executable wazuh-agent
`_ZN5boost4asio6detail20co_spawn_entry_pointEPZNS1_20co_spawn_entry_pointINS1_16detached_handlerENS0_15any_io_executorENS1_21awaitable_as_functionIvS4_EEEENS0_9awaitableINS1_28awaitable_thread_entry_pointET0_EEPNS7_IvS9_EENS1_14co_spawn_stateIT_S9_T1_vEEE230_ZN5boost4asio6detail20co_spawn_entry_pointINS1_16detached_handlerENS0_15any_io_executorENS1_21awaitable_as_functionIvS4_EEEENS0_9awaitableINS1_28awaitable_thread_entry_pointET0_EEPNS7_IvS9_EENS1_14co_spawn_stateIT_S9_T1_vEE.Frame.destroy' referenced in section `.rodata.cst8' of modules/logcollector/libLogcollector.a(logcollector.cpp.o): defined in discarded section `.text._ZN5boost4asio6detail20co_spawn_entry_pointEPZNS1_20co_spawn_entry_pointINS1_16detached_handlerENS0_15any_io_executorENS1_21awaitable_as_functionIvS4_EEEENS0_9awaitableINS1_28awaitable_thread_entry_pointET0_EEPNS7_IvS9_EENS1_14co_spawn_stateIT_S9_T1_vEEE230_ZN5boost4asio6detail20co_spawn_entry_pointINS1_16detached_handlerENS0_15any_io_executorENS1_21awaitable_as_functionIvS4_EEEENS0_9awaitableINS1_28awaitable_thread_entry_pointET0_EEPNS7_IvS9_EENS1_14co_spawn_stateIT_S9_T1_vEE.Frame.destroy[_ZN5boost4asio6detail20co_spawn_entry_pointINS1_16detached_handlerENS0_15any_io_executorENS1_21awaitable_as_functionIvS4_EEEENS0_9awaitableINS1_28awaitable_thread_entry_pointET0_EEPNS7_IvS9_EENS1_14co_spawn_stateIT_S9_T1_vEE]' of modules/logcollector/libLogcollector.a(logcollector.cpp.o)
collect2: error: ld returned 1 exit status
make[2]: *** [wazuh-agent] Error 1
make[1]: *** [CMakeFiles/wazuh-agent.dir/all] Error 2
make: *** [all] Error 2
error: Bad exit status from /usr/local/var/tmp/rpm-tmp.xd9Atp (%build)

RPM build errors:
    Bad exit status from /usr/local/var/tmp/rpm-tmp.xd9Atp (%build)

This error occurs when we try to generate an RPM package by running the following command on the master branch:

./packages/generate_package.sh --system rpm -t agent --tag 5.0.0

We have identified that if we build using the "Debug" mode instead of "Release," this issue does not occur:

cmake . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j 16

2024-10-22

  • Tried various compiler flags and recompiling dependencies without success.
  • Investigated library and linker settings and Boost Asio configurations.
  • Resolved the issue by enabling position-independent code with CMAKE_POSITION_INDEPENDENT_CODE ON, which allowed the linker to properly handle shared libraries and resolve the symbols. I create this branch with the fix.

@wazuhci wazuhci moved this from In progress to Blocked in XDR+SIEM/Release 5.0.0 Oct 25, 2024
@havidarou havidarou removed the mvp label Oct 28, 2024
@wazuhci wazuhci moved this from Blocked to On hold in XDR+SIEM/Release 5.0.0 Oct 29, 2024
@wazuhci wazuhci moved this from In progress to On hold in XDR+SIEM/Release 5.0.0 Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue module/packages Agent packages type/enhancement Enhancement issue
Projects
Status: On hold
6 participants