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

ENV JVM_SUPPORT_RECOMMENDED_ARGS 不生效 #71

Open
luozhijunroy18 opened this issue Jul 1, 2024 · 5 comments
Open

ENV JVM_SUPPORT_RECOMMENDED_ARGS 不生效 #71

luozhijunroy18 opened this issue Jul 1, 2024 · 5 comments

Comments

@luozhijunroy18
Copy link

配置了ENV JVM_SUPPORT_RECOMMENDED_ARGS 不生效
看镜像里面色setenv.sh是直接替换为-Dupm.plugin.upload.enabled=true, 这个是处于什么原因考虑的呢
image

@haxqer
Copy link
Owner

haxqer commented Jul 2, 2024

看镜像里面色setenv.sh是直接替换为-Dupm.plugin.upload.enabled=true, 这个是处于什么原因考虑的呢

setenv.sh 是 jira 官方的脚本

个人猜测:

  • 功能需求:Dupm.plugin.upload.enabled可能是项目中一个特定的功能开关,这个开关控制着某个插件的上传功能。设置这个参数可能是为了开启或关闭这个功能。
  • 默认配置:可能是出于默认配置的考虑,将这个参数设置为特定的值,以确保项目在默认情况下按照预定的行为运行。
  • 兼容性或兼容性考虑:这个参数可能与其他依赖项或库的兼容性有关,设置特定的值可能是为了确保项目的兼容性

@luozhijunroy18
Copy link
Author

但是我从官方镜像atlassian/jira-software:ubuntu-jdk17里面find / -name "setenv.sh" 发现/opt/atlassian/jira/bin/setenv.sh里面的内容和您镜像的setenv.sh内容不一致。

#
# If the limit of files that Jira can open is too low, it will be set to this value.
#
MIN_NOFILES_LIMIT=16384

#
# One way to set the JIRA HOME path is here via this variable.  Simply uncomment it and set a valid path like /jira/home.  You can of course set it outside in the command terminal.  That will also work.
#
#JIRA_HOME=""

#
#  Occasionally Atlassian Support may recommend that you set some specific JVM arguments.  You can use this variable below to do that.
#
: ${JVM_SUPPORT_RECOMMENDED_ARGS:=""}

#
#  You can use variable below to modify garbage collector settings.
#  For Java 8 we recommend default settings
#  For Java 11 and relatively small heaps we recommend: -XX:+UseParallelGC
#  For Java 11 and larger heaps we recommend: -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent
#
JVM_GC_ARGS="-XX:+ExplicitGCInvokesConcurrent"

#
# The following 2 settings control the minimum and maximum given to the JIRA Java virtual machine.  In larger JIRA instances, the maximum amount will need to be increased.
#
: ${JVM_MINIMUM_MEMORY:=384m}
: ${JVM_MAXIMUM_MEMORY:=2048m}

#
# The following setting configures the size of JVM code cache.  A high value of reserved size allows Jira to work with more installed apps.
#
JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=${JVM_RESERVED_CODE_CACHE_SIZE:=512m}'

#
# The following are the required arguments for Jira.
#
JVM_REQUIRED_ARGS='-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory'

# Uncomment this setting if you want to import data without notifications
#
#DISABLE_NOTIFICATIONS=" -Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true"


#-----------------------------------------------------------------------------------
#
# In general don't make changes below here
#
#-----------------------------------------------------------------------------------

#-----------------------------------------------------------------------------------
# Prevents the JVM from suppressing stack traces if a given type of exception
# occurs frequently, which could make it harder for support to diagnose a problem.
#-----------------------------------------------------------------------------------
JVM_EXTRA_ARGS="-XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT"

CURRENT_NOFILES_LIMIT=$( ulimit -Hn )
ulimit -Sn $CURRENT_NOFILES_LIMIT
ulimit -n $(( CURRENT_NOFILES_LIMIT > MIN_NOFILES_LIMIT  ? CURRENT_NOFILES_LIMIT : MIN_NOFILES_LIMIT ))

PRGDIR=`dirname "$0"`
cat "${PRGDIR}"/jirabanner.txt

JIRA_HOME_MINUSD=""
if [ "$JIRA_HOME" != "" ]; then
    echo $JIRA_HOME | grep -q " "
    if [ $? -eq 0 ]; then
	    echo ""
	    echo "--------------------------------------------------------------------------------------------------------------------"
		echo "   WARNING : You cannot have a JIRA_HOME environment variable set with spaces in it.  This variable is being ignored"
	    echo "--------------------------------------------------------------------------------------------------------------------"
    else
		JIRA_HOME_MINUSD=-Djira.home=$JIRA_HOME
    fi
fi

JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JVM_CODE_CACHE_ARGS} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMENDED_ARGS} ${JVM_EXTRA_ARGS} ${JIRA_HOME_MINUSD} ${START_JIRA_JAVA_OPTS}"

export JAVA_OPTS

# DO NOT remove the following line
# !INSTALLER SET JAVA_HOME

echo ""
echo "If you encounter issues starting or stopping Jira, please see the Troubleshooting guide at https://docs.atlassian.com/jira/jadm-docs-094/Troubleshooting+installation"
echo ""
if [ "$JIRA_HOME_MINUSD" != "" ]; then
    echo "Using JIRA_HOME:       $JIRA_HOME"
fi

# set the location of the pid file
if [ -z "$CATALINA_PID" ] ; then
    if [ -n "$CATALINA_BASE" ] ; then
        CATALINA_PID="$CATALINA_BASE"/work/catalina.pid
    elif [ -n "$CATALINA_HOME" ] ; then
        CATALINA_PID="$CATALINA_HOME"/work/catalina.pid
    fi
fi
export CATALINA_PID

if [ -z "$CATALINA_BASE" ]; then
  if [ -z "$CATALINA_HOME" ]; then
    LOGBASE=$PRGDIR
    LOGTAIL=..
  else
    LOGBASE=$CATALINA_HOME
    LOGTAIL=.
  fi
else
  LOGBASE=$CATALINA_BASE
  LOGTAIL=.
fi

PUSHED_DIR=`pwd`
cd $LOGBASE
cd $LOGTAIL
LOGBASEABS=`pwd`
cd $PUSHED_DIR

echo ""
echo "Server startup logs are located in $LOGBASEABS/logs/catalina.out"```


同时我看https://github.com/haxqer/jira/issues/48#issuecomment-1989946673在这里提及的和您镜像的setenv.sh内容一致, 所以认为这个是您做的。 不知道我的分析是否正确。

@haxqer
Copy link
Owner

haxqer commented Jul 2, 2024

https://github.com/haxqer/jira/blob/rm/Dockerfile

这个文件,就是我做的 所有 的事情(所有命令都在这个dockerfile中):

  • 下载 jira 的官方安装包
  • 解压
  • 注入用于破解的 jar 包

@luozhijunroy18
Copy link
Author

感谢, 了解了, 可能官方的安装包和官方docker有出入,我暂时通过ENV: JVM_CODE_CACHE_ARGS把参数传入了。

@haxqer
Copy link
Owner

haxqer commented Jul 3, 2024

https://github.com/haxqer/jira/tree/build-your-own

这个分支是老领导 基于jira官方镜像做的,和你的思路是一样的,可以看下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants