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

Use private directory for temporary files #27609

Merged
merged 2 commits into from
Nov 30, 2017
Merged

Conversation

jasontedor
Copy link
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
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
Member Author

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

Copy link
Contributor

@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