Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix removal of svc wazuh install service solaris11 #3065

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions solaris/solaris11/generate_wazuh_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ create_package() {


# Package generation process
# Added creation of wazuh-agent.xml service manifest file
svcbundle -o wazuh-agent.xml -s service-name=application/wazuh-agent -s start-method="${install_path}/bin/${control_binary} start" -s stop-method="${install_path}/bin/${control_binary} stop" -s refresh-method="${install_path}/bin/${control_binary} restart"
pkgsend generate ${install_path} | pkgfmt > wazuh-agent.p5m.1
sed "s|<INSTALL_PATH>|${install_path}|" ${current_path}/postinstall.sh > ${current_path}/postinstall.sh.new
mv ${current_path}/postinstall.sh.new ${current_path}/postinstall.sh
Expand All @@ -192,12 +194,10 @@ create_package() {
mv wazuh-agent.p5m.1.aux_sed wazuh-agent.p5m.1
done
# Add service files
echo "file smf_manifest.xml path=lib/svc/manifest/site/post-install.xml owner=root group=sys mode=0744 restart_fmri=svc:/system/manifest-import:default" >> wazuh-agent.p5m.1
echo "file smf_manifest.xml path=lib/svc/manifest/site/wazuh-postinstall.xml owner=root group=sys mode=0744 restart_fmri=svc:/system/manifest-import:default" >> wazuh-agent.p5m.1
echo "dir path=var/ossec/installation_scripts owner=root group=bin mode=0755" >> wazuh-agent.p5m.1
echo "file postinstall.sh path=var/ossec/installation_scripts/postinstall.sh owner=root group=bin mode=0744" >> wazuh-agent.p5m.1
echo "file wazuh-agent path=etc/init.d/wazuh-agent owner=root group=sys mode=0744" >> wazuh-agent.p5m.1
echo "file S97wazuh-agent path=etc/rc2.d/S97wazuh-agent owner=root group=sys mode=0744" >> wazuh-agent.p5m.1
echo "file S97wazuh-agent path=etc/rc3.d/S97wazuh-agent owner=root group=sys mode=0744" >> wazuh-agent.p5m.1
echo "file wazuh-agent.xml path=lib/svc/manifest/application/wazuh-agent.xml owner=root group=sys mode=0744 restart_fmri=svc:/system/manifest-import:default" >> wazuh-agent.p5m.1

# Add user and group wazuh
echo "group groupname=wazuh" >> wazuh-agent.p5m.1
Expand Down
7 changes: 6 additions & 1 deletion solaris/solaris11/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ rm -rf ${SCA_TMP_DIR}

# Remove upgrade files after install/upgrade
rm -rf ${install_path}/installation_scripts/
rm -rf /lib/svc/manifest/site/post-install.xml

# Disable the wazuh-postinstall service
svcadm disable site/wazuh-postinstall

# Remove the wazuh-postinstall service manifest
rm -rf /lib/svc/manifest/site/wazuh-postinstall.xml
6 changes: 3 additions & 3 deletions solaris/solaris11/smf_manifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" ?>
<!DOCTYPE service_bundle
SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type="manifest" name="site/wazuh-install">
<service version="1" type="service" name="site/wazuh-install">
<service_bundle type="manifest" name="site/wazuh-postinstall">
<service version="1" type="service" name="site/wazuh-postinstall">
<dependency restart_on="none" type="service"
name="multi_user_dependency" grouping="require_all">
<service_fmri value="svc:/milestone/multi-user"/>
Expand All @@ -20,4 +20,4 @@
</property_group>
<instance enabled="true" name="default"> </instance>
</service>
</service_bundle>
</service_bundle>