Skip to content

Commit

Permalink
Update prerm script to avoid stopping the service on upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Oct 24, 2024
1 parent 3806408 commit b2d1265
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions distribution/packages/src/deb/debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,31 @@

set -e

echo "Running Wazuh Indexer Pre-Removal Script"

# Stop existing service
if command -v systemctl >/dev/null && systemctl is-active wazuh-indexer.service >/dev/null; then
echo "Stop existing wazuh-indexer.service"
systemctl --no-reload stop wazuh-indexer.service
fi
if command -v systemctl >/dev/null && systemctl is-active wazuh-indexer-performance-analyzer.service >/dev/null; then
echo "Stop existing wazuh-indexer-performance-analyzer.service"
systemctl --no-reload stop wazuh-indexer-performance-analyzer.service
fi
case "$1" in
upgrade|deconfigure)
;;

remove)
echo "Running Wazuh Indexer Pre-Removal Script"
# Stop existing service
if command -v systemctl >/dev/null && systemctl is-active wazuh-indexer.service >/dev/null; then
echo "Stop existing wazuh-indexer.service"
systemctl --no-reload stop wazuh-indexer.service
fi
if command -v systemctl >/dev/null && systemctl is-active wazuh-indexer-performance-analyzer.service >/dev/null; then
echo "Stop existing wazuh-indexer-performance-analyzer.service"
systemctl --no-reload stop wazuh-indexer-performance-analyzer.service
fi
;;

failed-upgrade)
;;

*)
echo "prerm called with unknown argument \`$1'" >&2
exit 0
;;

esac

exit 0

0 comments on commit b2d1265

Please sign in to comment.