Skip to content

Detect mktemp from coreutils#27659

Merged
jasontedor merged 1 commit intoelastic:masterfrom
jasontedor:mktemp-coreutils
Dec 5, 2017
Merged

Detect mktemp from coreutils#27659
jasontedor merged 1 commit intoelastic:masterfrom
jasontedor:mktemp-coreutils

Conversation

@jasontedor
Copy link
Copy Markdown
Member

GNU mktemp and BSD mktemp have different command line flags. On some macOS systems users have mktemp from coreutils in their PATH overriding the system mktemp from BSD. This commit adds detection for the coreutils mktemp versus the BSD mktemp and uses the appropriate syntax based on the detection.

Relates #27609, relates #27643

GNU mktemp and BSD mktemp have different command line flags. On some
macOS systems users have mktemp from coreutils in their PATH overriding
the system mktemp from BSD. This commit adds detection for the coreutils
mktemp versus the BSD mktemp and uses the appropriate syntax based on
the detection.
@jasontedor jasontedor added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts review v6.2.0 v7.0.0 labels Dec 5, 2017
@jasontedor jasontedor requested a review from dakrone December 5, 2017 00:17
Copy link
Copy Markdown
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM

@jasontedor jasontedor merged commit 2208a1a into elastic:master Dec 5, 2017
jasontedor added a commit that referenced this pull request Dec 5, 2017
GNU mktemp and BSD mktemp have different command line flags. On some
macOS systems users have mktemp from coreutils in their PATH overriding
the system mktemp from BSD. This commit adds detection for the coreutils
mktemp versus the BSD mktemp and uses the appropriate syntax based on
the detection.

Relates #27659
@jasontedor jasontedor deleted the mktemp-coreutils branch December 5, 2017 00:53
@jasontedor
Copy link
Copy Markdown
Member Author

Thanks for your help with this one @dakrone.

droberts195 added a commit to droberts195/elasticsearch that referenced this pull request Dec 8, 2017
When using mktemp from coreutils there was an 's' missing from
elasticsearch.

Follow-up for elastic#27659
droberts195 added a commit that referenced this pull request Dec 8, 2017
When using mktemp from coreutils there was an 's' missing from
elasticsearch.

Follow-up for #27659
droberts195 added a commit that referenced this pull request Dec 8, 2017
When using mktemp from coreutils there was an 's' missing from
elasticsearch.

Follow-up for #27659
@iyabchen
Copy link
Copy Markdown

iyabchen commented Feb 6, 2018

Could it also include supports for alpine linux (to reduce the docker image size)?

There is no "coreutils" in busybox msg.

$ mktemp --help
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.

Usage: mktemp [-dt] [-p DIR] [TEMPLATE]

Create a temporary file with name based on TEMPLATE and print its name.
TEMPLATE must end with XXXXXX (e.g. [/dir/]nameXXXXXX).
Without TEMPLATE, -t tmp.XXXXXX is assumed.

-d	Make directory, not file
-q	Fail silently on errors
-t	Prepend base directory name to TEMPLATE
-p DIR	Use DIR as a base directory (implies -t)
-u	Do not create anything; print a name

Base directory is: -p DIR, else $TMPDIR, else /tmp

@jasontedor
Copy link
Copy Markdown
Member Author

@plmnko You can set ES_TMPDIR inside the container and Elasticsearch will use that as its value for java.io.tmpdir and will skip using mktemp in this case.

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