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

Agent not restarted during (unattended) deb pkg upgrade (systemd) #237

Open
d4nys3k opened this issue Oct 24, 2024 · 0 comments
Open

Agent not restarted during (unattended) deb pkg upgrade (systemd) #237

d4nys3k opened this issue Oct 24, 2024 · 0 comments

Comments

@d4nys3k
Copy link

d4nys3k commented Oct 24, 2024

Wazuh version Component Install type Install method Platform
4.9.1 Wazuh agent Agent Debian packages all debian/ubuntu versions

During .deb package upgrade in Debian/Ubuntu envinronments with systemd, agent isn't restarted properly.

This is due to bad workflow in preinst/prerm/postinst scripts. See installation workflow in documentation.

At the first, prerm script is called - this stops wazuh-agent. After this, preinst script is called - this script tries to check, if wazuh-agent is running by calling systemctl is-active --quiet wazuh-agent - but at this time unit is already inactive. So ${WAZUH_TMP_DIR}/wazuh.restart file isn't created and code in postinst code doesn't start agent, because ${WAZUH_TMP_DIR}/wazuh.restart doesn't exist.

I think ${WAZUH_TMP_DIR}/wazuh.restart should be created in prerm script to restart agent after upgrade properly.

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

No branches or pull requests

1 participant