Fix removal of svc wazuh install service solaris11#3065
Open
seon-beyondunderscore wants to merge 3 commits intowazuh:masterfrom
Open
Fix removal of svc wazuh install service solaris11#3065seon-beyondunderscore wants to merge 3 commits intowazuh:masterfrom
seon-beyondunderscore wants to merge 3 commits intowazuh:masterfrom
Conversation
added 3 commits
August 2, 2024 14:59
…ost-install to wazuh-postinstall
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
Problem Description:
After installing the Wazuh agent Solaris package and before rebooting, the service
svc:/site/wazuh-install:defaultis in theonlinestate. However, after rebooting the system, the following status is observed:sudo svcs|grep wazuhreveals that the Wazuh agent serviceslrc:/etc/rc2_d/S97wazuh-agentandlrc:/etc/rc3_d/S97wazuh-agentare in thelegacy_runstate.svc:/site/wazuh-install:defaultservice is in themaintenancestate.Upon further investigation using
svcs -xv svc:/site/wazuh-install:default, it is found that the service has been in themaintenancestate since the reboot, with the reason being that the start method failed repeatedly, exiting with status 127. The log file/var/svc/log/site-wazuh-install:default.logindicates that the start method is attempting to executevar/ossec/installation_scripts/postinstall.sh, but this script is not found, leading to the service failure.Log File Excerpt:
The Wazuh agent service fails to start after a system reboot because the post-installation script
var/ossec/installation_scripts/postinstall.shis missing, resulting in the service entering the maintenance state.I fixed the problem by disabling the wazuh-install service before removing the service manifest file. Additional changes included renaming wazuh-install to wazuh-postinstall to better reflect its purpose. I also added the wazuh-agent service to the Service Management Facility (SMF) and removed the legacy run service to ensure a clean service management setup.
Now, after installation, the process will automatically uninstall the wazuh-postinstall service and enable the wazuh-agent service. The wazuh-agent service will initially be in a maintenance state until the ossec.conf file is updated. Once the configuration is updated, the service can be cleared from maintenance and restarted using the svcs command.
Now clean and online:
Logs example
Log File Excerpt:
Tests
%filessection is correctly updated if necessaryTest the package on Solaris 10
[ x] Test the package on Solaris 11
Check file permissions on Solaris 11 template
%filessection is correctly updated if necessary