Skip to content
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
3 changes: 2 additions & 1 deletion distribution/src/main/resources/bin/elasticsearch
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ parse_jvm_options() {

ES_JVM_OPTIONS="$ES_PATH_CONF"/jvm.options

ES_JAVA_OPTS="`parse_jvm_options "$ES_JVM_OPTIONS"` $ES_JAVA_OPTS"
JVM_OPTIONS=`parse_jvm_options "$ES_JVM_OPTIONS"`
ES_JAVA_OPTS="${JVM_OPTIONS//\$\{ES_TMPDIR\}/$ES_TMPDIR} $ES_JAVA_OPTS"

# manual parsing to find out, if process should be detached
if ! echo $* | grep -E '(^-d |-d$| -d |--daemonize$|--daemonize )' > /dev/null; then
Expand Down
8 changes: 8 additions & 0 deletions distribution/src/main/resources/bin/elasticsearch-env
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ if [ -z "$ES_PATH_CONF" ]; then
echo "ES_PATH_CONF must be set to the configuration path"
exit 1
fi

if [ -z "$ES_TMPDIR" ]; then
if [ "`uname`" == "Darwin" ]; then
ES_TMPDIR=`mktemp -d -t elasticsearch`
else
ES_TMPDIR=`mktemp -d -t elasticsearch.XXXXXXXX`
fi
fi
4 changes: 4 additions & 0 deletions distribution/src/main/resources/bin/elasticsearch-env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ set HOSTNAME=%COMPUTERNAME%
if not defined ES_PATH_CONF (
set ES_PATH_CONF=!ES_HOME!\config
)

if not defined ES_TMPDIR (
set ES_TMPDIR=!TMP!\elasticsearch
)
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

@setlocal
for /F "usebackq delims=" %%a in (`findstr /b \- "%ES_JVM_OPTIONS%" ^| findstr /b /v "\-server \-client"`) do set JVM_OPTIONS=!JVM_OPTIONS!%%a;
@endlocal & set ES_JAVA_OPTS=%JVM_OPTIONS%%ES_JAVA_OPTS%
@endlocal & set ES_JAVA_OPTS=%JVM_OPTIONS:${ES_TMPDIR}=!ES_TMPDIR!%%ES_JAVA_OPTS%

if "%ES_JAVA_OPTS:~-1%"==";" set ES_JAVA_OPTS=%ES_JAVA_OPTS:~0,-1%

Expand Down
2 changes: 1 addition & 1 deletion distribution/src/main/resources/bin/elasticsearch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set "ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options"
rem extract the options from the JVM options file %ES_JVM_OPTIONS%
rem such options are the lines beginning with '-', thus "findstr /b"
for /F "usebackq delims=" %%a in (`findstr /b \- "%ES_JVM_OPTIONS%"`) do set JVM_OPTIONS=!JVM_OPTIONS! %%a
@endlocal & set ES_JAVA_OPTS=%JVM_OPTIONS% %ES_JAVA_OPTS%
@endlocal & set ES_JAVA_OPTS=%JVM_OPTIONS:${ES_TMPDIR}=!ES_TMPDIR!% %ES_JAVA_OPTS%

%JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!

Expand Down
2 changes: 2 additions & 0 deletions distribution/src/main/resources/config/jvm.options
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true

-Djava.io.tmpdir=${ES_TMPDIR}

## heap dumps

# generate a heap dump when an allocation from the Java heap fails
Expand Down