Skip to content

Commit

Permalink
Don't create tempdir for cli scripts
Browse files Browse the repository at this point in the history
The elasticsearch-cli helper script does not use the tempdir created by
elasticsearch-env, yet the env script still creates it. This can lead to
lots of temp directories being created when running cli scripts in an
automated fashion. This commit passes a fake tmpdir to the env script to
avoid creation.

closes elastic#34445
  • Loading branch information
rjernst committed May 7, 2019
1 parent 8bff716 commit 1996c18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions distribution/src/bin/elasticsearch-cli
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e -o pipefail

# set tempdir to non empty string so env script does not create it, as it is not used here
ES_TMPDIR="notused"
source "`dirname "$0"`"/elasticsearch-env

IFS=';' read -r -a additional_sources <<< "$ES_ADDITIONAL_SOURCES"
Expand Down
3 changes: 3 additions & 0 deletions distribution/src/bin/elasticsearch-cli.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

rem set tempdir to non empty string so env script does not create it, as it is not used here
set ES_TMPDIR="notused"
call "%~dp0elasticsearch-env.bat" || exit /b 1

if defined ES_ADDITIONAL_SOURCES (
Expand Down

0 comments on commit 1996c18

Please sign in to comment.