Skip to content

Commit

Permalink
Document how to set ES_TMPDIR in the service file (elastic#93121)
Browse files Browse the repository at this point in the history
Today we suggest that users set `ES_TMPDIR` using `export`, which only
works if you're running things directly from the shell. Yet most users
encountering `ES_TMPDIR` problems seem to on RHEL and trying to run
things via `systemd`, for whom the `export` suggestion doesn't work.

This commit adds to the docs a suggestion of how to adjust the `systemd`
service file to set the appropriate environment variable.

Relates elastic#80651
  • Loading branch information
DaveCTurner committed Jan 23, 2023
1 parent 3c89876 commit fde15b2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/reference/setup/sysconfig/executable-jna-tmpdir.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,22 @@ filesystem, or configure {es} to use a different location for its temporary
directory by setting the <<es-tmpdir,`$ES_TMPDIR`>> environment variable. For
instance:

* If you are running {es} directly from a shell, set `$ES_TMPDIR` as follows:
+
["source","sh",subs="attributes"]
--------------------------------------------
export ES_TMPDIR=/usr/share/elasticsearch/tmp
--------------------------------------------

* If you are using `systemd` to run {es} as a service, using the `systemctl`
command, add the following line to the `[Service]` section of your
`elasticsearch.service` unit file:
+
[source,text]
--------------------------------------------
Environment=ES_TMPDIR=/usr/share/elasticsearch/tmp
--------------------------------------------

If you need finer control over the location of these temporary files, you can
also configure the path that JNA uses with the <<set-jvm-options,JVM flag>>
`-Djna.tmpdir=<path>` and you can configure the path that `libffi` uses for its
Expand Down

0 comments on commit fde15b2

Please sign in to comment.