Skip to content

Commit e2b15f9

Browse files
Remove prein check in rpm to be consistent with deb pkg (#4542)
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent d8b397c commit e2b15f9

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

scripts/pkg/build_templates/current/opensearch/rpm/opensearch.rpm.spec

-25
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,6 @@ if command -v systemctl >/dev/null && systemctl is-active opensearch-performance
9090
echo "Stop existing opensearch-performance-analyzer.service"
9191
systemctl --no-reload stop opensearch-performance-analyzer.service
9292
fi
93-
94-
# Check if OPENSEARCH_INITIAL_ADMIN_PASSWORD is defined
95-
# TODO:
96-
# 1. This check will need to be modified if there will be a min dist for deb in future (currently there is none)
97-
# 2. Currently, the demo config setup is defined to run, in postinst, if `opensearch-security` is present. Cannot apply the same check here since the plugins folder is not available yet.
98-
99-
# Check if this is an upgrade by checking whether opensearch already exists
100-
if rpm -q opensearch >/dev/null 2>&1 || yum list installed opensearch >/dev/null 2>&1; then
101-
OPENSEARCH_ALREADY_INSTALLED="yes"
102-
else
103-
OPENSEARCH_ALREADY_INSTALLED="no"
104-
fi
105-
106-
OPENSEARCH_REQUIRED_VERSION="2.12.0"
107-
OPENSEARCH_VERSION=%{_version}
108-
MINIMUM_OF_TWO_VERSIONS=`echo $OPENSEARCH_REQUIRED_VERSION $OPENSEARCH_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
109-
110-
if [ "$OPENSEARCH_ALREADY_INSTALLED" = "no" ]; then
111-
if [ "$MINIMUM_OF_TWO_VERSIONS" = "$OPENSEARCH_REQUIRED_VERSION" ] && [ -z "$OPENSEARCH_INITIAL_ADMIN_PASSWORD" ]; then
112-
echo "ERROR: Opensearch 2.12 and later requires the env variable OPENSEARCH_INITIAL_ADMIN_PASSWORD to be defined to setup the opensearch-security demo configuration"
113-
echo "For more details, please visit: https://opensearch.org/docs/latest/install-and-configure/install-opensearch/rpm/"
114-
exit 1
115-
fi
116-
fi
117-
11893
# Create user and group if they do not already exist.
11994
getent group %{name} > /dev/null 2>&1 || groupadd -r %{name}
12095
getent passwd %{name} > /dev/null 2>&1 || \

0 commit comments

Comments
 (0)