Skip to content

Use private directory for temporary files#27609

Merged
jasontedor merged 2 commits intoelastic:masterfrom
jasontedor:tmpdir
Nov 30, 2017
Merged

Use private directory for temporary files#27609
jasontedor merged 2 commits intoelastic:masterfrom
jasontedor:tmpdir

Conversation

@jasontedor
Copy link
Copy Markdown
Member

This change ensures that the temporary directory used for java.io.tmpdir is a private temporary directory. To achieve this we use mktemp on macOS and Linux to give us a private temporary directory and the value of the environment variable TMP on Windows. For this to work with our packaging, we add java.io.tmpdir=${ES_TMPDIR} to our packaged jvm.options, we set ES_TMPDIR respectively in our startup scripts, and resolve the value of the template ${ES_TMPDIR} at startup.

Relates #14372, supersedes #27144

This change ensures that the temporary directory used for java.io.tmpdir
is a private temporary directory. To achieve this we use mktemp on macOS
and Linux to give us a private temporary directory and the value of the
environment variable TMP on Windows. For this to work with our
packaging, we add java.io.tmpdir=${ES_TMPDIR} to our packaged
jvm.options, we set ES_TMPDIR respectively in our startup scripts, and
resolve the value of the template ${ES_TMPDIR} at startup.
Copy link
Copy Markdown
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. I am not familiar with the windows syntax, and it looks odd since the left side looks like a substitution, but I trust you have tested it.

@jasontedor
Copy link
Copy Markdown
Member Author

Yes, fully tested both the startup script and the service.

Copy link
Copy Markdown

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM2

@jasontedor jasontedor merged commit d30c887 into elastic:master Nov 30, 2017
jasontedor added a commit that referenced this pull request Nov 30, 2017
This change ensures that the temporary directory used for java.io.tmpdir
is a private temporary directory. To achieve this we use mktemp on macOS
and Linux to give us a private temporary directory and the value of the
environment variable TMP on Windows. For this to work with our
packaging, we add java.io.tmpdir=${ES_TMPDIR} to our packaged
jvm.options, we set ES_TMPDIR respectively in our startup scripts, and
resolve the value of the template ${ES_TMPDIR} at startup.

Relates #27609
@jasontedor jasontedor deleted the tmpdir branch November 30, 2017 19:23
@jasontedor jasontedor added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts and removed :Core/Infra/Core Core issues without another label labels Dec 1, 2017
tylerjl added a commit to tylerjl/puppet-elasticsearch that referenced this pull request Dec 4, 2017
droberts195 added a commit to droberts195/elasticsearch that referenced this pull request May 2, 2018
If the elasticsearch-env bash script chooses $ES_TMPDIR
then it also creates the directory.  This change makes
elasticsearch-env.bat do the same thing: if %ES_TMPDIR%
is chosen by the script then the script will ensure it
exists, but if %ES_TMPDIR% is already set then the user
is responsible for creating it.

Relates elastic#27609
Relates elastic#28217
droberts195 added a commit that referenced this pull request May 2, 2018
If the elasticsearch-env bash script chooses $ES_TMPDIR
then it also creates the directory.  This change makes
elasticsearch-env.bat do the same thing: if %ES_TMPDIR%
is chosen by the script then the script will ensure it
exists, but if %ES_TMPDIR% is already set then the user
is responsible for creating it.

Relates #27609
Relates #28217
droberts195 added a commit that referenced this pull request May 2, 2018
If the elasticsearch-env bash script chooses $ES_TMPDIR
then it also creates the directory.  This change makes
elasticsearch-env.bat do the same thing: if %ES_TMPDIR%
is chosen by the script then the script will ensure it
exists, but if %ES_TMPDIR% is already set then the user
is responsible for creating it.

Relates #27609
Relates #28217
droberts195 added a commit that referenced this pull request May 2, 2018
If the elasticsearch-env bash script chooses $ES_TMPDIR
then it also creates the directory.  This change makes
elasticsearch-env.bat do the same thing: if %ES_TMPDIR%
is chosen by the script then the script will ensure it
exists, but if %ES_TMPDIR% is already set then the user
is responsible for creating it.

Relates #27609
Relates #28217
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >enhancement Team:Delivery Meta label for Delivery team v6.2.0 v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants