Skip to content

Commit

Permalink
Add PA service stop before install and uninstall (#2062)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Apr 29, 2022
1 parent e7d94ea commit 39e58d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/pkg/build_templates/opensearch/opensearch.rpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ if command -v systemctl >/dev/null && systemctl is-active %{name}.service >/dev/
echo "Stop existing %{name}.service"
systemctl --no-reload stop %{name}.service
fi
if command -v systemctl >/dev/null && systemctl is-active opensearch-performance-analyzer.service >/dev/null; then
echo "Stop existing opensearch-performance-analyzer.service"
systemctl --no-reload stop opensearch-performance-analyzer.service
fi
# Create user and group if they do not already exist.
getent group %{name} > /dev/null 2>&1 || groupadd -r %{name}
getent passwd %{name} > /dev/null 2>&1 || \
Expand Down Expand Up @@ -121,6 +125,10 @@ if command -v systemctl >/dev/null && systemctl is-active %{name}.service >/dev/
echo "Stop existing %{name}.service"
systemctl --no-reload stop %{name}.service
fi
if command -v systemctl >/dev/null && systemctl is-active opensearch-performance-analyzer.service >/dev/null; then
echo "Stop existing opensearch-performance-analyzer.service"
systemctl --no-reload stop opensearch-performance-analyzer.service
fi
exit 0

%files
Expand Down

0 comments on commit 39e58d8

Please sign in to comment.