Make Wazuh's building process independent of any predefined installation path#7327
Merged
chemamartinez merged 187 commits into4.2from Mar 30, 2021
Merged
Make Wazuh's building process independent of any predefined installation path#7327chemamartinez merged 187 commits into4.2from
chemamartinez merged 187 commits into4.2from
Conversation
…ies-detect-installation-path
…wazuh into 6958-defaultdir-behaviour
57cd06d to
afcd027
Compare
8b34cb1 to
715b81a
Compare
chemamartinez
previously approved these changes
Mar 30, 2021
dca1378 to
aeaad1e
Compare
chemamartinez
approved these changes
Mar 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hi team,
This pull request aims to include several changes to make Wazuh's building process independent of any predefined installation path. As described in the related issue, some requirements related to both scripts and source code have been met:
Makefile and scripts
Both scripts and Makefile have been modified to make the install path only mandatory during installation time. By default, it is still
/var/ossec.Both
Makefileand scripts have been modified to allow compatibility with the new embedded python interpreter.Source code
In order to adapt Wazuh's binaries to work without any predefined installation path, several changes have been introduced in the source code:
chdir()to the path found.Makefile options
From now on, there will be two main approaches regarding Wazuh's Python dependencies:
make depswill download a portable Python interpreter in atar.gzfile.make deps PYTHON_SOURCE=y|Y|yes|YES|1will download the sources required to build and install the Python interpreter, inside the cpython directory. Using this interpreter will require Wazuh to be compiled along with theINSTALLDIRvariable set to the installing directory.Some configuration examples:
How binaries work
All binaries and daemons have been modified to get their installation path automatically, in runtime. This allows them to use relative paths when accessing Wazuh-related resources. If the attempt at obtaining the install path fails, the binaries will try to obtain it from the
WAZUH_HOMEenvironment variable, which should be previously set by the user, as shown in the next example.Logs/Alerts example
A new debug message has been included to print the install location once it has been obtained:
Despite all modifications, the standard installation provides a successful log:
Tests
Compilation without warnings in every supported platform
Source installation
Memory tests for Linux