Skip to content

Commit

Permalink
Fix rpm build (#200)
Browse files Browse the repository at this point in the history
Signed-off-by: sruti1312 <srutiparthiban@gmail.com>
  • Loading branch information
sruti1312 committed Apr 27, 2022
1 parent 6ac5b1a commit bd0b4ce
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
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

0 comments on commit bd0b4ce

Please sign in to comment.