Fix removal of svc wazuh install service solaris11 #3065
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:default
is in theonline
state. However, after rebooting the system, the following status is observed:sudo svcs|grep wazuh
reveals that the Wazuh agent serviceslrc:/etc/rc2_d/S97wazuh-agent
andlrc:/etc/rc3_d/S97wazuh-agent
are in thelegacy_run
state.svc:/site/wazuh-install:default
service is in themaintenance
state.Upon further investigation using
svcs -xv svc:/site/wazuh-install:default
, it is found that the service has been in themaintenance
state 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.log
indicates 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.sh
is 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
%files
section is correctly updated if necessaryTest the package on Solaris 10
[ x] Test the package on Solaris 11
Check file permissions on Solaris 11 template
%files
section is correctly updated if necessary