voxpupuli / puppet-jira

Atlassian JIRA Puppet Module
https://forge.puppet.com/puppet/jira
Apache License 2.0
62 stars 144 forks source link

JVM_OPENS not set for JIRA Java 17 support #412

Closed valentino-aguiar-gsa closed 7 months ago

valentino-aguiar-gsa commented 8 months ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Regular jira class puppet definition.

What are you seeing

Atlassian requires special JVM parameters for Java 17 support as per: https://jira.atlassian.com/browse/JRASERVER-76224

Currently the setenv.sh does not set these, the result is that java 17 does not work at all with jira 9.5 +.

What behaviour did you expect instead

The following block should be included in setenv.sh in order to support java 17, if jre17/jfk17 is being used:

JVM_OPENS=$(cat $PRGDIR/java-opens.txt) JAVA_OPTS="$JVM_OPENS $JAVA_OPTS"

(before export JAVA_OPTS)

Output log

Any additional information you'd like to impart

I have copy pasted the block from atlassian upstream into my own forked puppet-jira:

j_ver=`echo "$($JAVA_HOME/bin/java -version 2>&1)" | grep "version" | awk '{ print substr($3, 2, length($3)-2); }'`
IFS='.' read -a j_ver_parts <<< "$j_ver"

if [[ ${j_ver_parts[0]} = 17 ]]; then
  JVM_OPENS=$(cat $PRGDIR/java-opens.txt)
  JAVA_OPTS="$JVM_OPENS $JAVA_OPTS"
fi

Potentially we may want to instead use variables etc in puppet to implement this instead as it will be less of a hack than atlassian did. I'll whip up a PR if I have time.