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

Fix rpm build by adding config to env variable #200

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3b7af77bf18cd2e6d27ae094175304573662bbe1
c65b3ad1382943f3bcd628d388b1497cc8a1fc70
17 changes: 11 additions & 6 deletions packaging/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ if [ -z "$OPENSEARCH_HOME" ]; then
OPENSEARCH_HOME=/usr/share/opensearch
fi

# Make sure the OPENSEARCH_PATH_CONF environment variable is set
if [ -z "$OPENSEARCH_PATH_CONF" ]; then
OPENSEARCH_PATH_CONF=/etc/opensearch
fi

# Prepare the RCA reader process for execution
mv "$OPENSEARCH_HOME"/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OPENSEARCH_HOME
mkdir -p "$OPENSEARCH_HOME"/data
Expand All @@ -19,13 +24,13 @@ chown opensearch /var/lib/opensearch/rca_enabled.conf
chown -R opensearch "$OPENSEARCH_HOME/performance-analyzer-rca"
chmod a+rw /tmp

if ! grep -q '## OpenSearch Performance Analyzer' /etc/opensearch/jvm.options; then
if ! grep -q '## OpenSearch Performance Analyzer' $OPENSEARCH_PATH_CONF/jvm.options; then
CLK_TCK=`/usr/bin/getconf CLK_TCK`
echo >> /etc/opensearch/jvm.options
echo '## OpenSearch Performance Analyzer' >> /etc/opensearch/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> /etc/opensearch/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> /etc/opensearch/jvm.options
echo "-Djava.security.policy=file:///usr/share/opensearch/config/opensearch-performance-analyzer/opensearch_security.policy" >> /etc/opensearch/jvm.options
echo >> $OPENSEARCH_PATH_CONF/jvm.options
echo '## OpenSearch Performance Analyzer' >> $OPENSEARCH_PATH_CONF/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> $OPENSEARCH_PATH_CONF/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> $OPENSEARCH_PATH_CONF/jvm.options
echo "-Djava.security.policy=file://$OPENSEARCH_PATH_CONF/opensearch-performance-analyzer/opensearch_security.policy" >> $OPENSEARCH_PATH_CONF/jvm.options
fi

IS_UPGRADE=false
Expand Down
2 changes: 1 addition & 1 deletion packaging/performance-analyzer-agent-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

PA_AGENT_JAVA_OPTS="-Dlog4j.configurationFile=$OPENSEARCH_HOME/config/opensearch-performance-analyzer/log4j2.xml \
PA_AGENT_JAVA_OPTS="-Dlog4j.configurationFile=$OPENSEARCH_PATH_CONF/opensearch-performance-analyzer/log4j2.xml \
-Xms64M -Xmx64M -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:-TieredCompilation -XX:InitialCodeCacheSize=4096 \
-XX:MaxRAM=400m"

Expand Down
17 changes: 11 additions & 6 deletions packaging/rpm/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if [ -z "$OPENSEARCH_HOME" ]; then
OPENSEARCH_HOME=/usr/share/opensearch
fi

# Make sure the OPENSEARCH_PATH_CONF environment variable is set
if [ -z "$OPENSEARCH_PATH_CONF" ]; then
OPENSEARCH_PATH_CONF=/etc/opensearch
fi

# Prepare the RCA reader process for execution
mv "$OPENSEARCH_HOME"/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OPENSEARCH_HOME
mkdir -p "$OPENSEARCH_HOME"/data
Expand All @@ -25,13 +30,13 @@ chown opensearch /var/lib/opensearch/rca_enabled.conf
chown -R opensearch "$OPENSEARCH_HOME/performance-analyzer-rca"
chmod a+rw /tmp

if ! grep -q '## OpenSearch Performance Analyzer' /etc/opensearch/jvm.options; then
if ! grep -q '## OpenSearch Performance Analyzer' $OPENSEARCH_PATH_CONF/jvm.options; then
CLK_TCK=`/usr/bin/getconf CLK_TCK`
echo >> /etc/opensearch/jvm.options
echo '## OpenSearch Performance Analyzer' >> /etc/opensearch/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> /etc/opensearch/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> /etc/opensearch/jvm.options
echo "-Djava.security.policy=file:///usr/share/opensearch/config/opensearch-performance-analyzer/opensearch_security.policy" >> /etc/opensearch/jvm.options
echo >> $OPENSEARCH_PATH_CONF/jvm.options
echo '## OpenSearch Performance Analyzer' >> $OPENSEARCH_PATH_CONF/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> $OPENSEARCH_PATH_CONF/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> $OPENSEARCH_PATH_CONF/jvm.options
echo "-Djava.security.policy=file://$OPENSEARCH_PATH_CONF/opensearch-performance-analyzer/opensearch_security.policy" >> $OPENSEARCH_PATH_CONF/jvm.options
fi

IS_UPGRADE=false
Expand Down