Closed davidcr01 closed 7 months ago
The approach of this issue may be change the way the dependencies are uninstalled. But, a more effective and faster way to solve this is changing the order of the execution of the script, by performing the HW check before the dependencies installation.
This should be done carefully in order not to break the natural order of the script, and provoking and undesired behavior (for example, checks the HW in an uninstallation case)
root@ubuntu22:/home/vagrant# bash wazuh-install.sh -a
10/04/2024 08:12:57 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
10/04/2024 08:12:57 INFO: Verbose logging redirected to /var/log/wazuh-install.log
10/04/2024 08:12:58 INFO: Verifying that your system meets the recommended minimum hardware requirements.
10/04/2024 08:12:58 ERROR: Your system does not meet the recommended minimum hardware requirements of 4Gb of RAM and 2 CPU cores. If you want to proceed with the installation use the -i option to ignore these requirements.
root@ubuntu22:/home/vagrant#
Notice that the script does not install any dependencies, and the installation is stopped because the HW check failed.
:heavy_check_mark: This does not change other options of the Installation Assistant: for example, the HW check is not performed when generating certificates:
root@ubuntu22:/home/vagrant# bash wazuh-install.sh -g
10/04/2024 08:13:34 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
10/04/2024 08:13:34 INFO: Verbose logging redirected to /var/log/wazuh-install.log
10/04/2024 08:13:35 INFO: Verifying that your system meets the recommended minimum hardware requirements.
10/04/2024 08:13:56 INFO: --- Configuration files ---
10/04/2024 08:13:56 INFO: Generating configuration files.
10/04/2024 08:13:56 INFO: Generating the root certificate.
10/04/2024 08:13:56 INFO: Generating Admin certificates.
10/04/2024 08:13:57 INFO: Generating Wazuh indexer certificates.
10/04/2024 08:13:57 INFO: Generating Filebeat certificates.
10/04/2024 08:13:57 INFO: Generating Wazuh dashboard certificates.
10/04/2024 08:13:58 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
root@ubuntu22:/home/vagrant#
The HW check keeps displaying but the check is not performed. In order to avoid this, I changed the location when this message is printed:
Verifying that your system meets the recommended minimum hardware requirements.
Description
Related: https://github.com/wazuh/wazuh-packages/issues/2660 In https://github.com/wazuh/wazuh/issues/22831, we have observed that, if the system does not verify the hardware requirements, the
lsof
package and its dependencies are not removed from the system. It is necessary to modify the code to clean the system in this case.Tasks
Verify that the
lsof
package and its dependencies are removed when the HW checks failed.