wazuh-packages
wazuh-packages copied to clipboard
Fix `command not found` when uninstalling `macOS` after generating the Wazuh agent package
| Wazuh version | Install type | Action performed | Platform |
|---|---|---|---|
| 4.3 | Agent | Build | macOS |
Hi team,
While generating macOS packages to check the signing and notarization process, I have seen the following error:
Ticket added. Ready to release the package.
sudo: /Library/Ossec/bin/ossec-control: command not found
No receipt for 'com.wazuh.pkg.wazuh-agent' found at '/'.
No receipt for 'com.wazuh.pkg.wazuh-agent-etc' found at '/'.
The ossec-control error is related to https://github.com/wazuh/wazuh-packages/blob/712361c9fe9d294cba9227cb469bd1c791aa2132/macos/uninstall.sh#L4
Since no distinction is being made between versions, the solution would consist of adding an if statement to see if the binary exists.
Regarding the No receipt for messages, they seem to be related to:
https://github.com/wazuh/wazuh-packages/blob/712361c9fe9d294cba9227cb469bd1c791aa2132/macos/uninstall.sh#L20 https://github.com/wazuh/wazuh-packages/blob/712361c9fe9d294cba9227cb469bd1c791aa2132/macos/uninstall.sh#L21
This message needs investigation to see if it should be classified as an error.
This does not affect the package generation process since the uninstall.sh script is only used for package generation automation, perhaps it would be interesting to add it as Packages built-in uninstaller so that the user has this script for a more comfortable uninstall.
Regards, Raúl.