executable-jna-tmpdir.asciidoc 1.4 KB

123456789101112131415161718192021222324
  1. [[executable-jna-tmpdir]]
  2. === JNA temporary directory not mounted with `noexec`
  3. [NOTE]
  4. This is only relevant for Linux.
  5. Elasticsearch uses the Java Native Access (JNA) library for executing some
  6. platform-dependent native code. On Linux, the native code backing this library
  7. is extracted at runtime from the JNA archive. By default, this code is extracted
  8. to the Elasticsearch temporary directory which defaults to a sub-directory of
  9. `/tmp`. Alternatively, this location can be controlled with the JVM flag
  10. `-Djna.tmpdir=<path>`. As the native library is mapped into the JVM virtual
  11. address space as executable, the underlying mount point of the location that
  12. this code is extracted to must *not* be mounted with `noexec` as this prevents
  13. the JVM process from being able to map this code as executable. On some hardened
  14. Linux installations this is a default mount option for `/tmp`. One indication
  15. that the underlying mount is mounted with `noexec` is that at startup JNA will
  16. fail to load with a `java.lang.UnsatisfiedLinkerError` exception with a message
  17. along the lines of `failed to map segment from shared object`. Note that the
  18. exception message can differ amongst JVM versions. Additionally, the components
  19. of Elasticsearch that rely on execution of native code via JNA will fail with
  20. messages indicating that it is `because JNA is not available`. If you are seeing
  21. such error messages, you must remount the temporary directory used for JNA to
  22. not be mounted with `noexec`.