# Elastic Search can't been started without execute rights on /tmp

**URL:** <https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149>\
**Category:** Elasticsearch\
**Created:** [October 21, 2024, 12:23pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149 "2024-10-21T12:23:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mscheepers](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mscheepers](https://discuss.elastic.co/u/mscheepers)\
**Post date:** [October 21, 2024, 12:23pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/1 "2024-10-21T12:23:05Z")

</div>

Hi All,  
I noticed when starting the Elasticsearch services on our RHEL 9 machine is failing when it's been installed with RPM's.  
The startup is failing as its trying to execute files on the /tmp path. This is by default not possible as it mounted as no-exec.

i found a article what is mentioning the variable ES\_TMPDIR but this doesn't do the trick.

i'm running version 8.15.2

Any suggestions?

Michel

---

<div class="post-metadata">

**Author:** ![Damian\_Pfister](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damian_pfister/32/133438_2.png) [@Damian\_Pfister](https://discuss.elastic.co/u/Damian_Pfister)\
**Post date:** [October 21, 2024, 1:33pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/2 "2024-10-21T13:33:06Z")

</div>

Hi Michel,

You mentioned that the ES\_TMPDIR route didn't work. Where in [this doc](https://www.elastic.co/guide/en/elasticsearch/reference/8.16/executable-jna-tmpdir.html) did you have challenges?

Thanks  
Damian

---

<div class="post-metadata">

**Author:** ![mscheepers](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mscheepers](https://discuss.elastic.co/u/mscheepers)\
**Post date:** [October 21, 2024, 1:56pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/3 "2024-10-21T13:56:38Z")

</div>

Hi @Damian_Pfister thanks for responding:

i have edit the systemd override file as mentioned in the doc. But when i start elastic after it is still looking at the /tmp

see here some journalctl log of the startup:

```auto
Oct 21 15:53:34 EDR04 systemd-entrypoint[2616]: Oct 21, 2024 3:53:34 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
Oct 21 15:53:34 EDR04 systemd-entrypoint[2616]: WARNING: COMPAT locale provider will be removed in a future release
Oct 21 15:53:35 EDR04 systemd-entrypoint[2616]: Failed to load native library:jansi-2.4.0-9fd69cf2dbe4a98f-libjansi.so. The native library file at /tmp/elasticsearch-665951078554207538/jansi-2.4.0-9fd69cf2dbe4a>
Oct 21 15:53:35 EDR04 systemd-entrypoint[2616]: java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-665951078554207538/jansi-2.4.0-9fd69cf2dbe4a98f-libjansi.so: /tmp/elasticsearch-665951078554207538/jansi-2.4.0->
Oct 21 15:53:35 EDR04 systemd-entrypoint[2616]: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/my-test-EDR.log
Oct 21 15:53:36 EDR04 systemd-entrypoint[2616]: ERROR: Elasticsearch died while starting up, with exit code 1
Oct 21 15:53:36 EDR04 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE

```

---

<div class="post-metadata">

**Author:** ![Damian\_Pfister](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damian_pfister/32/133438_2.png) [@Damian\_Pfister](https://discuss.elastic.co/u/Damian_Pfister)\
**Post date:** [October 21, 2024, 2:30pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/4 "2024-10-21T14:30:19Z")

</div>

Hi @mscheepers

Looking at our [Configuring system settings](https://www.elastic.co/guide/en/elasticsearch/reference/8.16/setting-system-settings.html#systemd) doc it mentions either going the `/etc/systemd/system/elasticsearch.service.d/override.conf` route or `sudo systemctl edit elasticsearch`. Which did you take? Can you confirm the change was actually applied (with a `cat` of the file)? Perhaps it is not reading the entry correctly, due to the systemd service not being restarted `sudo systemctl daemon-reload`?

Perhaps as an alternative you could attempt the `-Djna.tmpdir=<path>` java parameter option mentioned in [Advanced configuration](https://www.elastic.co/guide/en/elasticsearch/reference/8.16/advanced-configuration.html#set-jvm-options).

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 21, 2024, 3:10pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/5 "2024-10-21T15:10:11Z")

</div>

> [@Damian\_Pfister](#):
>
> Perhaps as an alternative you could attempt the `-Djna.tmpdir=<path>` java parameter

This is not good advice - see [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/executable-jna-tmpdir.html) for more details on why setting `-Djna.tmpdir` is insufficient. Setting `${ES_TMPDIR}` is the right answer. If ES isn't seeing that environment variable then that's the problem to address.

---

<div class="post-metadata">

**Author:** ![mscheepers](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mscheepers](https://discuss.elastic.co/u/mscheepers)\
**Post date:** [October 21, 2024, 3:13pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/6 "2024-10-21T15:13:59Z")

</div>

Hi @Damian_Pfister,

i used the method : Systemctl edit elasticsearch... and indeed reloaded the deamon..

showing the cat:  
[root@EDR04 ~]# cat /etc/systemd/system/elasticsearch.service.d/override.conf  
Environment=ES\_TMPDIR=/usr/share/elasticsearch/tmp  
[root@EDR04 ~]#

---

<div class="post-metadata">

**Author:** ![mscheepers](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mscheepers](https://discuss.elastic.co/u/mscheepers)\
**Post date:** [October 21, 2024, 3:19pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/7 "2024-10-21T15:19:05Z")

</div>

hi David,  
It looks that setting is not been picked up or is not been followed. Also when i try to export the variable manually then its not been followed during startup.

Michel

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 21, 2024, 3:46pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/8 "2024-10-21T15:46:50Z")

</div>

Hmm that is strange. Can you try and locate the full stack trace for the `java.lang.UnsatisfiedLinkError`? It should be in a log somewhere.

---

<div class="post-metadata">

**Author:** ![mscheepers](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mscheepers](https://discuss.elastic.co/u/mscheepers)\
**Post date:** [October 21, 2024, 5:01pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/9 "2024-10-21T17:01:01Z")

</div>

Hi David, that is also my assumption that its something strange:

```auto
[2024-10-09T16:29:20,848][INFO][o.e.n.NativeAccess] [EDR04] Using native vector library; to disable start with -Dorg.elasticsearch.nativeaccess.enableVectorLibrary=false
[2024-10-09T16:29:21,579][INFO][o.e.n.NativeAccess] [EDR04] Using [jdk] native provider and native methods for [Linux]
[2024-10-09T16:29:21,778][WARN][o.e.b.Natives] [EDR04] unable to load JNA native support library, native methods will be disabled. See https://www.elastic.co/guide/en/elasticsearch/reference/8.15/executable-jna-tmpdir.html
java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-10622378458092083345/jna104089939045083595.tmp: /tmp/elasticsearch-10622378458092083345/jna104089939045083595.tmp: failed to map segment from shared object
        at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
        at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331) ~[?:?]
        at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197) ~[?:?]
        at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139) ~[?:?]
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2399) ~[?:?]
        at java.lang.Runtime.load0(Runtime.java:852) ~[?:?]
        at java.lang.System.load(System.java:2030) ~[?:?]
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045) ~[jna-5.12.1.jar:?]
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015) ~[jna-5.12.1.jar:?]
        at com.sun.jna.Native.<clinit>(Native.java:221) ~[jna-5.12.1.jar:?]
        at jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method) ~[?:?]
        at jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160) ~[?:?]
        at java.lang.invoke.MethodHandles$Lookup.ensureInitialized(MethodHandles.java:2897) ~[?:?]
        at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:37) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:298) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:170) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:75) ~[elasticsearch-8.15.2.jar:?]
[2024-10-09T16:29:21,782][WARN][o.e.b.Natives] [EDR04] cannot install system call filter because JNA is not available
[2024-10-09T16:29:21,785][WARN][o.e.c.f.FileSystemNatives] [EDR04] unable to load JNA native support library, FileSystemNatives methods will be disabled.
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:413) ~[?:?]
        at java.lang.Class.forName(Class.java:404) ~[?:?]
        at org.elasticsearch.common.filesystem.FileSystemNatives.loadJnaProvider(FileSystemNatives.java:37) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.common.filesystem.FileSystemNatives.<clinit>(FileSystemNatives.java:31) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:332) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:170) ~[elasticsearch-8.15.2.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:75) ~[elasticsearch-8.15.2.jar:?]
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-10622378458092083345/jna104089939045083595.tmp: /tmp/elasticsearch-10622378458092083345/jna104089939045083595.tmp: failed to map segment from shared object [in thread "main"]
        at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
        at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331) ~[?:?]
        at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197) ~[?:?]
        at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139) ~[?:?]
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2399) ~[?:?]
        at java.lang.Runtime.load0(Runtime.java:852) ~[?:?]
        at java.lang.System.load(System.java:2030) ~[?:?]
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045) ~[jna-5.12.1.jar:?]
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015) ~[jna-5.12.1.jar:?]
        at com.sun.jna.Native.<clinit>(Native.java:221) ~[jna-5.12.1.jar:?]
        at jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method) ~[?:?]
        at jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160) ~[?:?]
"elasticsearch.log" 83L, 8096B

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 26, 2024, 9:18am UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/10 "2024-10-26T09:18:54Z")

</div>

Ok thanks, that really does look as if `systemd` is not picking up the env var you're trying to set.

Can you share the whole log from Elasticsearch? I'm particularly interested in the line which shows all the JVM command-line args.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 26, 2024, 10:55am UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/11 "2024-10-26T10:55:44Z")

</div>

Ah:

```plaintext
[root@EDR04 ~]# cat /etc/systemd/system/elasticsearch.service.d/override.conf
Environment=ES_TMPDIR=/usr/share/elasticsearch/tmp

```

You're missing a `[Service]` line. This file should contain the following:

```plaintext
[Service]
Environment=ES_TMPDIR=/usr/share/elasticsearch/tmp

```

See [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.15/setting-system-settings.html#systemd) for more info.

---

<div class="post-metadata">

**Author:** ![mscheepers](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@mscheepers](https://discuss.elastic.co/u/mscheepers)\
**Post date:** [October 27, 2024, 6:43pm UTC](https://discuss.elastic.co/t/elastic-search-cant-been-started-without-execute-rights-on-tmp/369149/12 "2024-10-27T18:43:41Z")

</div>

Thanks @DavidTurner that was indeed it.  
it's hard to find in the docs..

Thanks a lot again 🙏
