Closed rauldpm closed 1 year ago
The error is related with the following lines: https://github.com/wazuh/wazuh-packages/blob/551ed825724887f223858e629e38fbfdc1eaa1a1/unattended_installer/install_functions/installCommon.sh#L703-L704
Taking into account that the debug
variable has the following content if the verbose option is enabled:
https://github.com/wazuh/wazuh-packages/blob/8023b94a374010c6f99d81146bcd76d62e9db5ae/unattended_installer/install_functions/installMain.sh#L146-L147
The behavior of this code snippet is the following:
yum install ${dep} -y
command fails.2>&1 | tee -a ${logfile}
value, and the yum
error is redirected to the logfile
and to the command prompt.0
(success), and the if [ "${PIPESTATUS[0]}" != 0 ]; then
conditional is true.This is why the script continues the execution of the script with the verbose option.
Without the verbose option, the debug
variable has the following content:
https://github.com/wazuh/wazuh-packages/blob/551ed825724887f223858e629e38fbfdc1eaa1a1/unattended_installer/install_functions/installVariables.sh#L32
This is not a pipeline, but a redirection with >>
, so, when the yum
command fails, the if [ "${PIPESTATUS[0]}" != 0 ]; then
conditional is false and the script execution is stopped.
The functions installCommon_aptInstall
and installCommon_yumInstallList
have been modified. The strategy is to execute the installation command without the debug
variable, and store the code of the command in a variable and the output of command in another variable.
debug
variable.For instance:
yum_output=$(yum install ${dep} -y 2>&1)
yum_code="${PIPESTATUS[0]}"
eval "echo \${yum_output} ${debug}"
if [ "${yum_code}" != 0 ]; then
....
fi
Note: AL23 is not listed as recommended, but it should not affect the error reported
It has been found that when performing an AIO deployment using the WIA, the script reports an error related to the installation of curl even though it is already installed on the system
This is reported in version 4.6.0 of Wazuh: https://github.com/wazuh/wazuh-packages/issues/2432
The main problem comes when running in debug mode since it ignores the error and installs all the components successfully: wazuh-install.log
This assumes the following cases, which should not vary in the behavior of the script, the only difference that the debug should show is the detailed process, but if a step fails, the execution should terminate:
It is also necessary to determine if the curl fix must be incorporated into the next patch (4.5.3) or should be maintained for 4.6.0