Skip to content

Improve DEB and RPM packaging scripts #805

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

QU3B1M
Copy link
Member

@QU3B1M QU3B1M commented Apr 25, 2025

Description

Update the RPM and DEB packaging scripts improving the service status preservation after the upgrade process, and remove the custom Java temporary folder

Validations

DEB packages
  • Initial installation
    # dpkg -i wazuh-indexer_5.0.0-0_arm64_59a5a2f6-3b0c4dd-892e43b.deb
    Selecting previously unselected package wazuh-indexer.
    (Reading database ... 29263 files and directories currently installed.)
    Preparing to unpack wazuh-indexer_5.0.0-0_arm64_59a5a2f6-3b0c4dd-892e43b.deb ...
    Running Wazuh Indexer Pre-Installation Script
    Unpacking wazuh-indexer (5.0.0-0) ...
    Setting up wazuh-indexer (5.0.0-0) ...
    Running Wazuh Indexer Post-Installation Script
    ### NOT starting on installation, please execute the following statements to configure wazuh-indexer service to start automatically using systemd
     sudo systemctl daemon-reload
     sudo systemctl enable wazuh-indexer.service
    ### You can start wazuh-indexer service by executing
     sudo systemctl start wazuh-indexer.service
  • Upgrade with service already running
    # dpkg -i wazuh-indexer_5.0.0-0_arm64_59a5a2f6-3b0c4dd-892e43b.deb 
    (Reading database ... 30486 files and directories currently installed.)
    Preparing to unpack wazuh-indexer_5.0.0-0_arm64_59a5a2f6-3b0c4dd-892e43b.deb ...
    Running Wazuh Indexer Pre-Installation Script
    Verifying wazuh-indexer.service is stopped to proceed with the upgrade...
    wazuh-indexer.service is currently active; scheduling restart after the upgrade.
    Stop existing wazuh-indexer-performance-analyzer.service
    Unpacking wazuh-indexer (5.0.0-0) over (5.0.0-0) ...
    Setting up wazuh-indexer (5.0.0-0) ...
    Running Wazuh Indexer Post-Installation Script
    Restoring wazuh-indexer.service to its previous active state.
    
    # sudo systemctl status wazuh-indexer.service
    ● wazuh-indexer.service - wazuh-indexer
         Loaded: loaded (/lib/systemd/system/wazuh-indexer.service; disabled; vendor p>
         Active: active (running) since Mon 2025-04-28 16:39:59 UTC; 3min 54s ago
           Docs: https://documentation.wazuh.com
       Main PID: 13322 (java)
          Tasks: 113 (limit: 9413)
         Memory: 1.5G
            CPU: 40.150s
         CGroup: /system.slice/wazuh-indexer.service
                 └─13322 /usr/share/wazuh-indexer/jdk/bin/java -Xshare:auto -Dopensear>
  • Upgrade with service stopped
    # dpkg -i wazuh-indexer_5.0.0-0_arm64_59a5a2f6-3b0c4dd-892e43b.deb 
    (Reading database ... 30486 files and directories currently installed.)
    Preparing to unpack wazuh-indexer_5.0.0-0_arm64_59a5a2f6-3b0c4dd-892e43b.deb ...
    Running Wazuh Indexer Pre-Installation Script
    Verifying wazuh-indexer.service is stopped to proceed with the upgrade...
    Stop existing wazuh-indexer-performance-analyzer.service
    Unpacking wazuh-indexer (5.0.0-0) over (5.0.0-0) ...
    Setting up wazuh-indexer (5.0.0-0) ...
    Running Wazuh Indexer Post-Installation Script
    ### Service will remain stopped after the upgrade (previous state preserved).
    ### You can start wazuh-indexer service by executing
     sudo systemctl start wazuh-indexer.service
    
    # sudo systemctl status wazuh-indexer.service
    ● wazuh-indexer.service - wazuh-indexer
         Loaded: loaded (/lib/systemd/system/wazuh-indexer.service; disabled; vendor p>
         Active: inactive (dead)
           Docs: https://documentation.wazuh.com
RPM packages
  • Initial installation
    # rpm -i wazuh-indexer_5.0.0-0_aarch64_59a5a2f6-3b0c4dd-892e43b.rpm 
    ### NOT starting on installation, please execute the following statements to configure wazuh-indexer service to start automatically using systemd
     sudo systemctl daemon-reload
     sudo systemctl enable wazuh-indexer.service
    ### You can start the wazuh-indexer service by executing
     sudo systemctl start wazuh-indexer.service
  • Upgrade with service already running
    # # rpm -i --force wazuh-indexer_5.0.0-0_aarch64_59a5a2f6-3b0c4dd-892e43b.rpm 
    wazuh-indexer.service is currently active; scheduling restart after the upgrade.
    Restoring wazuh-indexer.service to its previous active state.
    
    # sudo systemctl status wazuh-indexer.service
    ● wazuh-indexer.service - wazuh-indexer
         Loaded: loaded (/usr/lib/systemd/system/wazuh-indexer.service; enabled; prese>
         Active: active (running) since Mon 2025-04-28 17:05:54 UTC; 14s ago
           Docs: https://documentation.wazuh.com
       Main PID: 5934 (java)
          Tasks: 77 (limit: 50368)
         Memory: 1.3G
            CPU: 12.566s
         CGroup: /system.slice/wazuh-indexer.service
                 └─5934 /usr/share/wazuh-indexer/jdk/bin/java -Xshare:auto -Dopensearc>
  • Upgrade with service stopped
    # rpm -i --force wazuh-indexer_5.0.0-0_aarch64_59a5a2f6-3b0c4dd-892e43b.rpm 
    ### Service will remain stopped after the upgrade (previous state preserved).
    ### You can start the wazuh-indexer service by executing
     sudo systemctl start wazuh-indexer.service
    
    # sudo systemctl status wazuh-indexer.service
    ○ wazuh-indexer.service - wazuh-indexer
         Loaded: loaded (/usr/lib/systemd/system/wazuh-indexer.service; enabled; prese>
         Active: inactive (dead) since Mon 2025-04-28 17:06:22 UTC; 38s ago
       Duration: 28.038s
           Docs: https://documentation.wazuh.com
       Main PID: 5934 (code=exited, status=143)
            CPU: 13.418s
### Related Issues Closes #804

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@QU3B1M QU3B1M self-assigned this Apr 25, 2025
@AlexRuiz7 AlexRuiz7 changed the title Enhancement/804 migrate packaging scripts fixes Remove custom Java temporary folder Apr 28, 2025
@QU3B1M QU3B1M force-pushed the enhancement/804-migrate-packaging-scripts-fixes branch from 07e34ad to e14ee1d Compare April 28, 2025 13:10
@QU3B1M QU3B1M marked this pull request as ready for review April 28, 2025 14:05
@QU3B1M QU3B1M requested a review from a team as a code owner April 28, 2025 14:05
@QU3B1M QU3B1M force-pushed the enhancement/804-migrate-packaging-scripts-fixes branch from e1eb203 to 59a5a2f Compare April 28, 2025 15:48
@QU3B1M QU3B1M requested a review from AlexRuiz7 April 28, 2025 15:55
@QU3B1M QU3B1M changed the title Remove custom Java temporary folder Packaging scripts improvements Apr 28, 2025
@QU3B1M QU3B1M changed the title Packaging scripts improvements Improve packaging scripts mechanism to preserve service status Apr 28, 2025
@QU3B1M QU3B1M changed the title Improve packaging scripts mechanism to preserve service status Improve DEB and RPM packaging scripts Apr 28, 2025
Update DEB and RPM packaging scripts removing tmp_dir references

Fix typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate #794 to main
2 participants