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

Add compatibility to sysv service manager on RPM and DEB distribution scripts #527

Closed
2 tasks
Tracked by #485
QU3B1M opened this issue Nov 7, 2024 · 1 comment
Closed
2 tasks
Tracked by #485
Assignees
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@QU3B1M
Copy link
Member

QU3B1M commented Nov 7, 2024

Description

Currently our packaging scripts (the ones from distribution/packages/src) only supports systemd as service manager, we update these scripts to also support sysv.

We can use the scripts from Wazuh-dashboard as example.

if [ -f "${INSTALLATION_DIR}"/"${NAME}".restart ]; then
        rm -f "${INSTALLATION_DIR}"/"${NAME}".restart
        if command -v systemctl >/dev/null 2>&1 && systemctl >/dev/null 2>&1; then
            systemctl daemon-reload >/dev/null 2>&1
            systemctl restart wazuh-dashboard.service >/dev/null 2>&1
        elif command -v service >/dev/null 2>&1 && service wazuh-dashboard status 2>/dev/null | grep "running" >/dev/null 2>&1; then
            service wazuh-dashboard restart >/dev/null 2>&1
        fi
    fi

Functional requirements

  • The packages can be installed, upgraded and removed on systems with sysv
  • On upgrade on sysv, the service should maintain its previous state (this behavior is currently working on systemd)

Plan

  • Update RPM packaging script to support sysv.
  • Update all the DEB packaging scripts to support sysv (postinst, preinst, and prerm)
@QU3B1M QU3B1M added level/task Task issue type/enhancement Enhancement issue labels Nov 7, 2024
@wazuhci wazuhci moved this to Backlog in Release 5.0.0 Nov 7, 2024
@wazuhci wazuhci moved this from Backlog to In progress in Release 5.0.0 Nov 12, 2024
@mcasas993 mcasas993 linked a pull request Nov 15, 2024 that will close this issue
3 tasks
@AlexRuiz7 AlexRuiz7 linked a pull request Nov 21, 2024 that will close this issue
3 tasks
@AlexRuiz7 AlexRuiz7 changed the title Add compatibility to sysv service manager on RPM and DEB distribution scripts Migration to OpenSearch's Debian scripts Nov 21, 2024
@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Nov 25, 2024

We have detected that we were using different Debian packages scripts made on our own, instead of using these from OpenSearch present in the repo, These include compatibility to systemd, service and other service managers.

Moreover, it may benefit from other feature such as removing configuration files on apt purge.

The goal now is to migrate our changes and use these Debian packages scripts, removing duplicated code.

We'll manage this on another issue (#564).

@AlexRuiz7 AlexRuiz7 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@AlexRuiz7 AlexRuiz7 changed the title Migration to OpenSearch's Debian scripts Add compatibility to sysv service manager on RPM and DEB distribution scripts Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/enhancement Enhancement issue
Projects
Status: In progress
3 participants